Skip to content

Added some comments #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions source/reference/meta-query-operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Introduction

In addition to the :doc:`MongoDB Query Operators
</reference/operators>`, there are a number of "meta" operators that
you may use to modify the output or behavior or output of the
you may use to modify the output or behavior of a
query. Specify these modifiers to a :func:`find()` query, in the
following form (for the :program:`mongo` shell):

Expand All @@ -18,7 +18,7 @@ following form (for the :program:`mongo` shell):
db.collection.find( { [QUERY] } )._addSpecial( [MODIFER] )

Here, the query specified by "``[QUERY]``" runs on the collection
named ``collection`` while the operation specified by the
named ``collection`` with the operation specified by the
``[MODIFER]`` The results are then processed by a modifier expression
selected from the following list. Many of the operators have
corresponding :doc:`methods in the shell </reference/javascript>`. For
Expand Down Expand Up @@ -90,6 +90,8 @@ Modifiers
Use operation alone or in conjunction with :operator:`$max`
to limit results to a specific range.

TODO This should be avoided unless necessary, use $gte instead.

.. operator:: $max

Specify a :operator:`$max` value to specify an upper boundary for
Expand All @@ -109,6 +111,8 @@ Modifiers
Use operation alone or in conjunction with :operator:`$min`
to limit results to a specific range.

TODO This should be avoided unless necessary, use $lt instead.

.. operator:: $query

The :operator:`$query` operator provides an interface to describe
Expand Down Expand Up @@ -148,7 +152,7 @@ Modifiers
value (e.g. "``1``") to sort in ascending order.

Unless you have a index for the specified key pattern, use
:operator:`$orderby` in conjunction with :operator:`$maxScan` and
:operator:`$orderby` in conjunction with :operator:`$maxScan` and/or
:func:`limit()` to avoid requiring MongoDB to perform a large
in-memory sort. :func:`limit()` increases the speed and reduce
the amount of memory required to return this query by way of an
Expand All @@ -168,6 +172,8 @@ Modifiers
"``collection``" using the index on the "``_id``" field. Use this
operator to prevent MongoDB from performing inefficient queries.

TODO - won't necessarily prevent an inefficient query, just lets you pick index manually.

.. operator:: $explain

Use the :operator:`$explain` operator to return a :term:`JSON
Expand Down Expand Up @@ -218,3 +224,5 @@ Modifiers

All queries with responses less than 1 megabyte are effectively
snapshotted.

TODO I don't think that's right about < 1 mb
Loading