diff --git a/source/faq/developers.txt b/source/faq/developers.txt index 7e25c5fcca0..c19e832b448 100644 --- a/source/faq/developers.txt +++ b/source/faq/developers.txt @@ -402,6 +402,8 @@ not to the whole cluster. For more information, see :doc:`/faq/concurrency`. +.. _faq-dev-compare-order-for-BSON-types: + What is the compare order for BSON types? ----------------------------------------- @@ -417,6 +419,7 @@ the following documents may exist within a single collection. When comparing values of different :term:`BSON` types, MongoDB uses the following compare order: +- MinKey (internal type) - Null - Numbers (ints, longs, doubles) - Symbol, String @@ -427,6 +430,7 @@ compare order: - Boolean - Date, Timestamp - Regular Expression +- MaxKey (internal type) .. note:: @@ -437,9 +441,9 @@ Consider the following :program:`mongo` example: .. code-block:: javascript - db.test.insert({x:3}); - db.test.insert( {x : 2.9} ); - db.test.insert( {x : new Date()} ); + db.test.insert( {x : 3 } ); + db.test.insert( {x : 2.9 } ); + db.test.insert( {x : new Date() } ); db.test.insert( {x : true } ); db.test.find().sort({x:1}); @@ -457,11 +461,14 @@ for additional information. .. seealso:: - - The :wiki:`Tailable Cursors ` wiki page for an - example of a C++ use of ``MinKey``. + - The :doc:`Tailable Cursors ` + page for an example of a C++ use of ``MinKey``. - - The :source:`jsobj.h ` source file for the - definition of ``MinKey`` and ``MaxKey``. +.. commenting out: per scott, we shouldn't be referencing source code; + *and* this header file actually doesn't contain anything other than + include statements + The :source:`jsobj.h ` source + file for the definition of ``MinKey`` and ``MaxKey``. .. _faq-developers-query-for-nulls: diff --git a/source/includes/table-mongodb-extended-json.yaml b/source/includes/table-mongodb-extended-json.yaml index 81349d95715..ec895177dda 100644 --- a/source/includes/table-mongodb-extended-json.yaml +++ b/source/includes/table-mongodb-extended-json.yaml @@ -9,12 +9,14 @@ rows: - 5: [ content.bson_oid, content.strict_oid, content.js_oid, content.mongo_oid, content.notes_oid ] - 6: [ content.bson_ref, content.strict_ref, content.js_ref, content.mongo_ref, content.notes_ref ] - 7: [ content.bson_undef, content.strict_undef, content.js_undef, content.mongo_undef, content.notes_undef ] + - 8: [ content.bson_minkey, content.strict_minkey, content.js_minkey, content.mongo_minkey, content.notes_minkey ] + - 9: [ content.bson_maxkey, content.strict_maxkey, content.js_maxkey, content.mongo_maxkey, content.notes_maxkey ] --- # table metadata, as meta. section: meta header1: "BSON Data Type" header2: "Strict Mode" -header3: "JavaScript Mode" +header3: "JavaScript Mode (via JSONP)" header4: "mongo Shell Mode" header5: "Notes" --- @@ -38,10 +40,7 @@ js_bin: | mongo_bin: | .. code-block:: javascript - { - "$binary": "", - "$type": "" - } + BinData ( , ) notes_bin: | ```` is the base64 representation of a binary string. @@ -58,14 +57,14 @@ strict_date: | js_date: | .. code-block:: javascript - Date( ) + new Date( ) mongo_date: | .. code-block:: javascript - Date ( ) + new Date ( ) notes_date: | ```` is the JSON representation of a 64-bit signed - integer for milliseconds since epoch (unsigned before + integer for milliseconds since epoch UTC (unsigned before version 1.9.1). bson_ts: ".. bsontype:: data_timestamp" strict_ts: | @@ -194,4 +193,49 @@ mongo_undef: | undefined notes_undef: | The representation for the JavaScript/BSON undefined type. +bson_minkey: ".. bsontype:: data_minkey" +strict_minkey: | + .. code-block:: javascript + + { + "$minKey": 1 + } +js_minkey: | + .. code-block:: javascript + + { + "$minKey": 1 + } +mongo_minkey: | + .. code-block:: javascript + + MinKey +notes_minkey: | + The representation of the MinKey BSON data type which + compares lower than all other types. See + :ref:`faq-dev-compare-order-for-BSON-types` for more + information on comparison order for BSON types. + +bson_maxkey: ".. bsontype:: data_maxkey" +strict_maxkey: | + .. code-block:: javascript + + { + "$maxKey": 1 + } +js_maxkey: | + .. code-block:: javascript + + { + "$maxKey": 1 + } +mongo_maxkey: | + .. code-block:: javascript + + MaxKey +notes_maxkey: | + The representation of the MaxKey BSON data type which + compares higher than all other types. See + :ref:`faq-dev-compare-order-for-BSON-types` for more + information on comparison order for BSON types. ... diff --git a/source/reference/mongodb-extended-json.txt b/source/reference/mongodb-extended-json.txt index ce9ea8ea82f..11ef9f23c0f 100644 --- a/source/reference/mongodb-extended-json.txt +++ b/source/reference/mongodb-extended-json.txt @@ -16,10 +16,11 @@ The REST interface supports three different modes for document output: specifications `_. - *JavaScript* mode that produces output that most JavaScript - interpreters can process + interpreters can process (via the ``--jsonp`` option) - :program:`mongo` *Shell* mode produces output that the - :program:`mongo` can process. This is "extended" JavaScript format. + :program:`mongo` shell can process. This is "extended" JavaScript + format. MongoDB can process of these representations in REST input.