Meta-Query Operators

Query Modifiers

Name Description
$comment Adds a comment to the query to identify queries in the database profiler output.
$explain Forces MongoDB to report on query execution plans. See explain().
$hint Forces MongoDB to use a specific index. See hint()
$maxScan Limits the number of documents a cursor will return for a query. See limit().
$max Specifies a minimum exclusive upper limit for the index to use in a query. See max().
$min Specifies a minimum inclusive lower limit for the index to use in a query. See min().
$orderby Returns a cursor with documents sorted according to a sort specification. See sort().
$returnKey Forces the cursor to only return fields included in the index.
$showDiskLoc Modifies the documents returned to include references to the on-disk location of each document.
$snapshot Forces the query to use the index on the _id field. See snapshot().
$query Wraps a query document.

Sort Order Specifier

Name Description
$natural A special sort order that orders documents using the order of documents on disk.