-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Add the following aliases:
- spec -> filter
- fields -> projection
- timeout -> no_cursor_timeout
- partial -> allow_partial_results
Add the following new options:
- cursor_type
- oplog_replay
- modifiers
With the exception of oplog_replay, all of these new parameters will be set to None by default. If a value for any of them is provided, the following rules apply:
A value for filter will take precedence over spec.
A value for projection will take precedence over fields.
A value for no_cursor_timeout will take precedence over timeout.
A value for allow_partial_results will take precedence over partial.
A value for cursor_type will take precedence over tailable, await_data, and exhaust.
A value for modifiers will be used as the basis for adding modifiers to the query filter. If $snapshot or $maxScan are passed in modifiers, they will take precedence over the snapshot and max_scan options.
Note that this should likely be enforced in pymongo.cursor.Cursor, so the the aliased options are automatically available in Collection.find_one, and can be trivially added to GridFS.find() and GridFS.find_one().
- depends on
-
PYTHON-883 Backport CursorType from 3.x
- Closed