Skip to content

Commit 58e1b03

Browse files
author
Sam Kleinman
committed
DOCS-138 revisions to operator reference in response to astaple's comments
1 parent 5a2acd3 commit 58e1b03

File tree

2 files changed

+133
-105
lines changed

2 files changed

+133
-105
lines changed

source/reference/meta-query-operators.rst

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ following form (for the :program:`mongo` shell):
1515

1616
.. code-block:: javascript
1717
18-
db.collection.find( { [QUERY] } )._addSpecial( [MODIFER] )
18+
db.collection.find( { [QUERY] } )._addSpecial( [MODIFIER] )
1919
2020
Here, the query specified by "``[QUERY]``" runs on the collection
2121
named ``collection`` with the operation specified by the
22-
``[MODIFER]`` The results are then processed by a modifier expression
22+
"``[MODIFIER]``". The results are then processed by a modifier expression
2323
selected from the following list. Many of the operators have
2424
corresponding :doc:`methods in the shell </reference/javascript>`. For
2525
the proposes of this reference, this document assumes the above form
@@ -90,7 +90,11 @@ Modifiers
9090
Use operation alone or in conjunction with :operator:`$max`
9191
to limit results to a specific range.
9292

93-
TODO This should be avoided unless necessary, use $gte instead.
93+
94+
.. note::
95+
96+
In most cases, you should avoid this operator in favor of
97+
:operator:`$gte`.
9498

9599
.. operator:: $max
96100

@@ -111,7 +115,10 @@ TODO This should be avoided unless necessary, use $gte instead.
111115
Use operation alone or in conjunction with :operator:`$min`
112116
to limit results to a specific range.
113117

114-
TODO This should be avoided unless necessary, use $lt instead.
118+
.. note::
119+
120+
In most cases, you should avoid this operator in favor of
121+
:operator:`$lt`.
115122

116123
.. operator:: $query
117124

@@ -161,18 +168,18 @@ TODO This should be avoided unless necessary, use $lt instead.
161168
.. operator:: $hint
162169

163170
Use the :operator:`$hint` operator to force the query optimizer to
164-
use a specific index to fulfill the query. Consider the following
165-
form:
171+
use a specific index to fulfill the query. Use :operator:`$hint`
172+
for testing query performance and indexing strategies. Consider
173+
the following form:
166174

167175
.. code-block:: javascript
168176
169177
db.collection.find()._addSpecial( "$hint", { _id : 1 } )
170178
171179
This operation returns all documents in the collection named
172180
"``collection``" using the index on the "``_id``" field. Use this
173-
operator to prevent MongoDB from performing inefficient queries.
174-
175-
TODO - won't necessarily prevent an inefficient query, just lets you pick index manually.
181+
operator to override MongoDB's default index selection process and
182+
pick indexes manually.
176183

177184
.. operator:: $explain
178185

@@ -222,7 +229,7 @@ TODO - won't necessarily prevent an inefficient query, just lets you pick index
222229
Do not use snapshot with :operator:`$hint`, or :operator:`$orderby`
223230
(:func:`sort()`.)
224231

225-
All queries with responses less than 1 megabyte are effectively
226-
snapshotted.
232+
.. All queries with responses less than 1 megabyte are effectively
233+
.. snapshotted.
227234
228-
TODO I don't think that's right about < 1 mb
235+
.. TODO "I don't think that's right about < 1 mb" --astaple

0 commit comments

Comments
 (0)