Skip to content

Commit 4b1434f

Browse files
committed
DOCS-617 crud draft fix typos
1 parent 2331f9d commit 4b1434f

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

draft/core/documents.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Consider the following examples of MongoDB documents:
6464
{ _id: 1 }
6565

6666
- The following document specifies the query criteria where ``_id``
67-
is greater to ``3``:
67+
is greater than ``3``:
6868

6969
.. code-block:: javascript
7070

@@ -80,14 +80,15 @@ Consider the following examples of MongoDB documents:
8080

8181
When passed as an argument to methods such as the :method:`find()
8282
<db.collection.find()>` method or the :method:`update()
83-
<db.collection.update()>` method, the query document limits the
84-
records returned or updated:
83+
<db.collection.update()>` method, the query document determines which
84+
records are returned or updated:
8585

8686
.. code-block:: javascript
8787

8888
db.csbios.find( { _id: 1 } )
8989
db.csbios.find( { _id: { $gt: 3 } } )
90-
db.csbios.find( { _id: 1, name: { first: 'John', last: 'Backus' } } )
90+
db.csbios.update( { _id: 1, name: { first: 'John', last: 'Backus' } },
91+
... )
9192

9293
- The following document specifies the update actions:
9394

@@ -115,25 +116,25 @@ Consider the following examples of MongoDB documents:
115116

116117
.. code-block:: javascript
117118

118-
{ 'name.last': 1 }
119+
{ 'name.last': 1, 'name.first':1 }
119120

120121
When passed as an argument to the :method:`sort() <cursor.sort()>`
121122
method, the document specifies the sort order of the results:
122123

123124
.. code-block:: javascript
124125

125-
db.csbios.find().sort( { 'name.last': 1 } )
126+
db.csbios.find().sort( { 'name.last': 1, 'name.first': 1 } )
126127

127-
- The following document specifies the index to create:
128+
- The following document specifies the multi-key index to create:
128129

129130
.. code-block:: javascript
130131

131-
{ id:1, 'name.last': 1 }
132+
{ _id:1, 'name.last': 1 }
132133

133134
When passed as an argument to the :method:`ensureIndex()
134135
<db.collection.ensureIndex()>` method, the document specifies the
135136
multi-key index to create on the fields ``_id`` and ``name.last``:
136137

137138
.. code-block:: javascript
138139

139-
db.csbios.ensureIndex( { id:1, 'name.last': 1 } )
140+
db.csbios.ensureIndex( { _id: 1, 'name.last': 1 } )

draft/core/read-operations.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ Consider the ``query`` arguments in the following :method:`find()
8686

8787
db.inventory.find( { type: { $in: [ 'food', 'snacks' ] } } )
8888

89+
.. note::
90+
91+
Although you can express this query using the :operator:`$or`
92+
operator, choose the :operator:`$in` operator rather than the
93+
:operator:`$or` operator when performing equality checks on the
94+
same field.
95+
8996
- Compound ``query`` argument specifies the criteria where the field
9097
``type`` equals ``food`` **and** the field ``price`` is less than
9198
``9.95``:

0 commit comments

Comments
 (0)