New in version 3.2.
Specifies a maximum number of documents or index keys the query plan will scan. Once the limit is reached, the query terminates execution and returns the current batch of results.
maxScan()has the following syntax:
cursor.maxScanhas the following parameter:
Parameter Type Description
int, long, or double The maximum number of documents or index keys that the query plan will scan. Returns: The cursor that
maxScan()is attached to with a modified result set based on the
maxScanparameter. This allows for additional cursor modifiers to be chained.
For collection scans,
maxScan is the maximum number of documents scanned before the query results are returned. For index scans,
maxScan is the maximum number of index keys examined.
Using a value of
0 is equivalent to not using