Skip to content

DOCS-1000 mirror changes to extended json wiki #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions source/faq/developers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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?
-----------------------------------------

Expand All @@ -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
Expand All @@ -427,6 +430,7 @@ compare order:
- Boolean
- Date, Timestamp
- Regular Expression
- MaxKey (internal type)

.. note::

Expand All @@ -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});
Expand All @@ -457,11 +461,14 @@ for additional information.

.. seealso::

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

- The :source:`jsobj.h <src/mongo/db/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 <src/mongo/db/jsobj.h>` source
file for the definition of ``MinKey`` and ``MaxKey``.

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

Expand Down
60 changes: 52 additions & 8 deletions source/includes/table-mongodb-extended-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>
section: meta
header1: "BSON Data Type"
header2: "Strict Mode"
header3: "JavaScript Mode"
header3: "JavaScript Mode (via JSONP)"
header4: "mongo Shell Mode"
header5: "Notes"
---
Expand All @@ -38,10 +40,7 @@ js_bin: |
mongo_bin: |
.. code-block:: javascript

{
"$binary": "<bindata>",
"$type": "<t>"
}
BinData ( <t>, <bindata> )
notes_bin: |
``<bindata>`` is the base64 representation of a binary
string.
Expand All @@ -58,14 +57,14 @@ strict_date: |
js_date: |
.. code-block:: javascript

Date( <date> )
new Date( <date> )
mongo_date: |
.. code-block:: javascript

Date ( <date> )
new Date ( <date> )
notes_date: |
``<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: |
Expand Down Expand Up @@ -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.
...
5 changes: 3 additions & 2 deletions source/reference/mongodb-extended-json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ The REST interface supports three different modes for document output:
specifications <http://www.json.org>`_.

- *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.

Expand Down