From 4b1434f9170c3c4a3fe3a9a7c145c7e904ac1ab5 Mon Sep 17 00:00:00 2001 From: kay Date: Mon, 22 Oct 2012 15:18:57 -0400 Subject: [PATCH] DOCS-617 crud draft fix typos --- draft/core/documents.txt | 19 ++++++++++--------- draft/core/read-operations.txt | 7 +++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/draft/core/documents.txt b/draft/core/documents.txt index 0b4ac1157f2..e7b8bb6b871 100644 --- a/draft/core/documents.txt +++ b/draft/core/documents.txt @@ -64,7 +64,7 @@ Consider the following examples of MongoDB documents: { _id: 1 } - The following document specifies the query criteria where ``_id`` - is greater to ``3``: + is greater than ``3``: .. code-block:: javascript @@ -80,14 +80,15 @@ Consider the following examples of MongoDB documents: When passed as an argument to methods such as the :method:`find() ` method or the :method:`update() - ` method, the query document limits the - records returned or updated: + ` method, the query document determines which + records are returned or updated: .. code-block:: javascript db.csbios.find( { _id: 1 } ) db.csbios.find( { _id: { $gt: 3 } } ) - db.csbios.find( { _id: 1, name: { first: 'John', last: 'Backus' } } ) + db.csbios.update( { _id: 1, name: { first: 'John', last: 'Backus' } }, + ... ) - The following document specifies the update actions: @@ -115,20 +116,20 @@ Consider the following examples of MongoDB documents: .. code-block:: javascript - { 'name.last': 1 } + { 'name.last': 1, 'name.first':1 } When passed as an argument to the :method:`sort() ` method, the document specifies the sort order of the results: .. code-block:: javascript - db.csbios.find().sort( { 'name.last': 1 } ) + db.csbios.find().sort( { 'name.last': 1, 'name.first': 1 } ) -- The following document specifies the index to create: +- The following document specifies the multi-key index to create: .. code-block:: javascript - { id:1, 'name.last': 1 } + { _id:1, 'name.last': 1 } When passed as an argument to the :method:`ensureIndex() ` method, the document specifies the @@ -136,4 +137,4 @@ Consider the following examples of MongoDB documents: .. code-block:: javascript - db.csbios.ensureIndex( { id:1, 'name.last': 1 } ) + db.csbios.ensureIndex( { _id: 1, 'name.last': 1 } ) diff --git a/draft/core/read-operations.txt b/draft/core/read-operations.txt index 701b9caa85a..7b3a39681d6 100644 --- a/draft/core/read-operations.txt +++ b/draft/core/read-operations.txt @@ -86,6 +86,13 @@ Consider the ``query`` arguments in the following :method:`find() db.inventory.find( { type: { $in: [ 'food', 'snacks' ] } } ) + .. note:: + + Although you can express this query using the :operator:`$or` + operator, choose the :operator:`$in` operator rather than the + :operator:`$or` operator when performing equality checks on the + same field. + - Compound ``query`` argument specifies the criteria where the field ``type`` equals ``food`` **and** the field ``price`` is less than ``9.95``: