@@ -64,7 +64,7 @@ Consider the following examples of MongoDB documents:
64
64
{ _id: 1 }
65
65
66
66
- The following document specifies the query criteria where ``_id``
67
- is greater to ``3``:
67
+ is greater than ``3``:
68
68
69
69
.. code-block:: javascript
70
70
@@ -80,14 +80,15 @@ Consider the following examples of MongoDB documents:
80
80
81
81
When passed as an argument to methods such as the :method:`find()
82
82
<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:
85
85
86
86
.. code-block:: javascript
87
87
88
88
db.csbios.find( { _id: 1 } )
89
89
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
+ ... )
91
92
92
93
- The following document specifies the update actions:
93
94
@@ -115,25 +116,25 @@ Consider the following examples of MongoDB documents:
115
116
116
117
.. code-block:: javascript
117
118
118
- { 'name.last': 1 }
119
+ { 'name.last': 1, 'name.first': 1 }
119
120
120
121
When passed as an argument to the :method:`sort() <cursor.sort()>`
121
122
method, the document specifies the sort order of the results:
122
123
123
124
.. code-block:: javascript
124
125
125
- db.csbios.find().sort( { 'name.last': 1 } )
126
+ db.csbios.find().sort( { 'name.last': 1, 'name.first': 1 } )
126
127
127
- - The following document specifies the index to create:
128
+ - The following document specifies the multi-key index to create:
128
129
129
130
.. code-block:: javascript
130
131
131
- { id :1, 'name.last': 1 }
132
+ { _id :1, 'name.last': 1 }
132
133
133
134
When passed as an argument to the :method:`ensureIndex()
134
135
<db.collection.ensureIndex()>` method, the document specifies the
135
136
multi-key index to create on the fields ``_id`` and ``name.last``:
136
137
137
138
.. code-block:: javascript
138
139
139
- db.csbios.ensureIndex( { id: 1, 'name.last': 1 } )
140
+ db.csbios.ensureIndex( { _id: 1, 'name.last': 1 } )
0 commit comments