Skip to content

Commit 07fdc2a

Browse files
committed
DOCS-1000 mirror changes to extended json wiki
1 parent 8166735 commit 07fdc2a

File tree

3 files changed

+69
-17
lines changed

3 files changed

+69
-17
lines changed

source/faq/developers.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ not to the whole cluster.
402402

403403
For more information, see :doc:`/faq/concurrency`.
404404

405+
.. _faq-dev-compare-order-for-BSON-types:
406+
405407
What is the compare order for BSON types?
406408
-----------------------------------------
407409

@@ -417,6 +419,7 @@ the following documents may exist within a single collection.
417419
When comparing values of different :term:`BSON` types, MongoDB uses the following
418420
compare order:
419421

422+
- MinKey (internal type)
420423
- Null
421424
- Numbers (ints, longs, doubles)
422425
- Symbol, String
@@ -427,6 +430,7 @@ compare order:
427430
- Boolean
428431
- Date, Timestamp
429432
- Regular Expression
433+
- MaxKey (internal type)
430434

431435
.. note::
432436

@@ -437,9 +441,9 @@ Consider the following :program:`mongo` example:
437441

438442
.. code-block:: javascript
439443

440-
db.test.insert({x:3});
441-
db.test.insert( {x : 2.9} );
442-
db.test.insert( {x : new Date()} );
444+
db.test.insert( {x : 3 } );
445+
db.test.insert( {x : 2.9 } );
446+
db.test.insert( {x : new Date() } );
443447
db.test.insert( {x : true } );
444448

445449
db.test.find().sort({x:1});
@@ -457,11 +461,14 @@ for additional information.
457461

458462
.. seealso::
459463

460-
- The :wiki:`Tailable Cursors <Tailable+Cursors>` wiki page for an
461-
example of a C++ use of ``MinKey``.
464+
- The :doc:`Tailable Cursors </tutorial/create-tailable-cursor>`
465+
page for an example of a C++ use of ``MinKey``.
462466

463-
- The :source:`jsobj.h <src/mongo/db/jsobj.h>` source file for the
464-
definition of ``MinKey`` and ``MaxKey``.
467+
.. commenting out: per scott, we shouldn't be referencing source code;
468+
*and* this header file actually doesn't contain anything other than
469+
include statements
470+
The :source:`jsobj.h <src/mongo/db/jsobj.h>` source
471+
file for the definition of ``MinKey`` and ``MaxKey``.
465472

466473
.. _faq-developers-query-for-nulls:
467474

source/includes/table-mongodb-extended-json.yaml

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ rows:
99
- 5: [ content.bson_oid, content.strict_oid, content.js_oid, content.mongo_oid, content.notes_oid ]
1010
- 6: [ content.bson_ref, content.strict_ref, content.js_ref, content.mongo_ref, content.notes_ref ]
1111
- 7: [ content.bson_undef, content.strict_undef, content.js_undef, content.mongo_undef, content.notes_undef ]
12+
- 8: [ content.bson_minkey, content.strict_minkey, content.js_minkey, content.mongo_minkey, content.notes_minkey ]
13+
- 9: [ content.bson_maxkey, content.strict_maxkey, content.js_maxkey, content.mongo_maxkey, content.notes_maxkey ]
1214
---
1315
# table metadata, as meta.<key>
1416
section: meta
1517
header1: "BSON Data Type"
1618
header2: "Strict Mode"
17-
header3: "JavaScript Mode"
19+
header3: "JavaScript Mode (via JSONP)"
1820
header4: "mongo Shell Mode"
1921
header5: "Notes"
2022
---
@@ -38,10 +40,7 @@ js_bin: |
3840
mongo_bin: |
3941
.. code-block:: javascript
4042
41-
{
42-
"$binary": "<bindata>",
43-
"$type": "<t>"
44-
}
43+
BinData ( <t>, <bindata> )
4544
notes_bin: |
4645
``<bindata>`` is the base64 representation of a binary
4746
string.
@@ -58,14 +57,14 @@ strict_date: |
5857
js_date: |
5958
.. code-block:: javascript
6059
61-
Date( <date> )
60+
new Date( <date> )
6261
mongo_date: |
6362
.. code-block:: javascript
6463
65-
Date ( <date> )
64+
new Date ( <date> )
6665
notes_date: |
6766
``<date>`` is the JSON representation of a 64-bit signed
68-
integer for milliseconds since epoch (unsigned before
67+
integer for milliseconds since epoch UTC (unsigned before
6968
version 1.9.1).
7069
bson_ts: ".. bsontype:: data_timestamp"
7170
strict_ts: |
@@ -194,4 +193,49 @@ mongo_undef: |
194193
undefined
195194
notes_undef: |
196195
The representation for the JavaScript/BSON undefined type.
196+
bson_minkey: ".. bsontype:: data_minkey"
197+
strict_minkey: |
198+
.. code-block:: javascript
199+
200+
{
201+
"$minKey": 1
202+
}
203+
js_minkey: |
204+
.. code-block:: javascript
205+
206+
{
207+
"$minKey": 1
208+
}
209+
mongo_minkey: |
210+
.. code-block:: javascript
211+
212+
MinKey
213+
notes_minkey: |
214+
The representation of the MinKey BSON data type which
215+
compares lower than all other types. See
216+
:ref:`faq-dev-compare-order-for-BSON-types` for more
217+
information on comparison order for BSON types.
218+
219+
bson_maxkey: ".. bsontype:: data_maxkey"
220+
strict_maxkey: |
221+
.. code-block:: javascript
222+
223+
{
224+
"$maxKey": 1
225+
}
226+
js_maxkey: |
227+
.. code-block:: javascript
228+
229+
{
230+
"$maxKey": 1
231+
}
232+
mongo_maxkey: |
233+
.. code-block:: javascript
234+
235+
MaxKey
236+
notes_maxkey: |
237+
The representation of the MaxKey BSON data type which
238+
compares higher than all other types. See
239+
:ref:`faq-dev-compare-order-for-BSON-types` for more
240+
information on comparison order for BSON types.
197241
...

source/reference/mongodb-extended-json.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ The REST interface supports three different modes for document output:
1616
specifications <http://www.json.org>`_.
1717

1818
- *JavaScript* mode that produces output that most JavaScript
19-
interpreters can process
19+
interpreters can process (via the ``--jsonp`` option)
2020

2121
- :program:`mongo` *Shell* mode produces output that the
22-
:program:`mongo` can process. This is "extended" JavaScript format.
22+
:program:`mongo` shell can process. This is "extended" JavaScript
23+
format.
2324

2425
MongoDB can process of these representations in REST input.
2526

0 commit comments

Comments
 (0)