@@ -23,9 +23,9 @@ iterates over the result set of matching :term:`documents` in a collection.
23
23
24
24
.. index:: read operations; query
25
25
.. index:: query; read operations
26
- .. _read-operations-query-operations :
26
+ .. _read-operations-query-operators :
27
27
28
- Read Operations
28
+ Read Operators
29
29
---------------
30
30
31
31
In the :program:`mongo` shell the :method:`find()
@@ -46,21 +46,19 @@ syntax:
46
46
in the :program:`mongo` shell to list the current collections in the
47
47
database.
48
48
49
- - Queries in MongoDB have a JSON-like syntax, and take the form of a
50
- :term:`document` using a collection of :doc:`/reference/operators`
51
- query operators to describe query parameters .
49
+ - The ``<query>`` argument specifies the selection criteria in the form
50
+ of JSON-like :doc:`core/documents` that use a set of
51
+ :doc:`/reference/ operators` to specify the query conditions .
52
52
53
- The ``<query>`` argument of the :method:`find()
54
- <db.collection.find()>` method holds this query document. A query,
55
- without a query document will return all documents in the
56
- collection.
53
+ The :method:`find() <db.collection.find()>` method without a query
54
+ argument will return all documents in the collection.
57
55
58
- - The ``<projection>`` argument describes describes the result or
59
- return set in the form of a document. Projections specify or limit
56
+ - The ``<projection>`` argument describes the result set
57
+ in the form of a document. Projections specify or limit
60
58
the fields to return.
61
59
62
60
Without a projection the operation will return all
63
- fields of all documents, specify a projection if your documents are
61
+ fields of all documents. Specify a projection if your documents are
64
62
larger, or when your application only needs a subset of available
65
63
fields.
66
64
@@ -158,7 +156,7 @@ query. Consider the following example query operations using the
158
156
159
157
db.inventory.find( { tags: "fruit" } )
160
158
161
- MongoDB provides a full complement of query selection operators such
159
+ MongoDB provides a full range of query selection operators such
162
160
as the :operator:`$lt` operator and the :operator:`$or`
163
161
operator. Refer to the :doc:`/reference/operators` document for the
164
162
complete list of query selection operators.
@@ -168,13 +166,13 @@ complete list of query selection operators.
168
166
Projection Argument
169
167
~~~~~~~~~~~~~~~~~~~
170
168
171
- The :term:`projection` specification, limits the fields to return for
172
- all matching. By narrowing the fields to return, projections can
173
- minimize network transit costs and the costs of deserializing document
174
- in the applications. In the ``<projection>`` argument, you can either
175
- specify the fields to include (``field:1``) or specify the fields to
176
- exclude (``field:0``). The ``_id`` field is implicitly included,
177
- unless explicitly excluded.
169
+ The :term:`projection` specification limits the fields to return for
170
+ all matching documents . By narrowing the fields to return, projections
171
+ can minimize network transit costs and the costs of deserializing
172
+ document in the applications. In the ``<projection>`` argument, you can
173
+ either specify the fields to include (``field:1``) or specify the
174
+ fields to exclude (``field:0``). The ``_id`` field is implicitly
175
+ included, unless explicitly excluded.
178
176
179
177
.. note::
180
178
@@ -217,9 +215,9 @@ Consider the following projection specifications, in the
217
215
218
216
db.inventory.find( { type: 'food' }, { type:0 } )
219
217
220
- MongoDB also provides the following projection operators, that allow
221
- richer projection specifications for fields that hold arrays. Refer to
222
- the operator documentation for the :projection:`$elemMatch` and
218
+ MongoDB also provides the projection operators that allow richer
219
+ projection specifications for fields that hold arrays. Refer to the
220
+ operator documentation for the :projection:`$elemMatch` and
223
221
:projection:`$slice` operators.
224
222
225
223
.. _read-operations-indexing:
@@ -228,10 +226,10 @@ Indexes
228
226
-------
229
227
230
228
Indexes improve the efficiency of read operations by reducing the work
231
- associated with fulfilling queries, by building a special structure
232
- and maintain that structure when inserting or modifying
233
- documents. These indexes support specific queries, sort operations,
234
- and allow for more efficient storage utilization.
229
+ associated with fulfilling queries, by building a special structure and
230
+ maintaining that structure during insert and update operations. These
231
+ indexes support specific queries and sort operations, and allow for
232
+ more efficient storage utilization.
235
233
236
234
Create indexes using the :method:`db.collection.ensureIndex{)` method
237
235
in the :program:`mongo` shell, as in the following prototype
@@ -286,8 +284,8 @@ To improve the performance of the query, create an index on the
286
284
287
285
db.inventory.ensureIndex( { type: 1 } )
288
286
289
- Compare the performance of the previous read operation, but now
290
- executed with the newly created index:
287
+ Compare the performance of the previous read operation now executed
288
+ with the newly created index:
291
289
292
290
.. code-block:: javascript
293
291
@@ -434,7 +432,7 @@ following methods and commands:
434
432
435
433
- :method:`group()`
436
434
437
- - :dbcommand:`mapReduce() <mapreduce>` (See also :wiki:`MapReduce`.)
435
+ - :dbcommand:`mapReduce() <mapreduce>`
438
436
439
437
.. index:: read operation; architecture
440
438
.. _read-operations-architecture:
@@ -444,12 +442,6 @@ Architecture
444
442
445
443
.. index:: read operation; connection pooling
446
444
.. index:: connection pooling; read operations
447
- .. _read-operations-connection-pooling:
448
-
449
- Connection Pooling
450
- ~~~~~~~~~~~~~~~~~~
451
-
452
- .. TODO
453
445
454
446
Sharded Clusters
455
447
~~~~~~~~~~~~~~~~
0 commit comments