|
def | __init__ (self, *args, **kwargs) |
|
def | explain (self) |
|
def | __getitem__ (self, index) |
|
def | __init__ (self, collection, filter=None, projection=None, skip=0, limit=0, no_cursor_timeout=False, cursor_type=CursorType.NON_TAILABLE, sort=None, allow_partial_results=False, oplog_replay=False, modifiers=None, batch_size=0, manipulate=True, collation=None, hint=None, max_scan=None, max_time_ms=None, max=None, min=None, return_key=False, show_record_id=False, snapshot=False, comment=None, session=None, allow_disk_use=None) |
|
def | collection (self) |
|
def | retrieved (self) |
|
def | __del__ (self) |
|
def | rewind (self) |
|
def | clone (self) |
|
def | close (self) |
|
def | add_option (self, mask) |
|
def | remove_option (self, mask) |
|
def | allow_disk_use (self, allow_disk_use) |
|
def | limit (self, limit) |
|
def | batch_size (self, batch_size) |
|
def | skip (self, skip) |
|
def | max_time_ms (self, max_time_ms) |
|
def | max_await_time_ms (self, max_await_time_ms) |
|
def | max_scan (self, max_scan) |
|
def | max (self, spec) |
|
def | min (self, spec) |
|
def | sort (self, key_or_list, direction=None) |
|
def | count (self, with_limit_and_skip=False) |
|
def | distinct (self, key) |
|
def | hint (self, index) |
|
def | comment (self, comment) |
|
def | where (self, code) |
|
def | collation (self, collation) |
|
def | alive (self) |
|
def | cursor_id (self) |
|
def | address (self) |
|
def | session (self) |
|
def | __iter__ (self) |
|
def | next (self) |
|
def | __enter__ (self) |
|
def | __exit__ (self, exc_type, exc_val, exc_tb) |
|
def | __copy__ (self) |
|
def | __deepcopy__ (self, memo) |
|
A cursor / iterator over raw batches of BSON data from a query result.
def __getitem__ |
( |
|
self, |
|
|
|
index |
|
) |
| |
Get a single document or a slice of documents from this cursor.
Raises :class:`~pymongo.errors.InvalidOperation` if this
cursor has already been used.
To get a single document use an integral index, e.g.::
>>> db.test.find()[50]
An :class:`IndexError` will be raised if the index is negative
or greater than the amount of documents in this cursor. Any
limit previously applied to this cursor will be ignored.
To get a slice of documents use a slice index, e.g.::
>>> db.test.find()[20:25]
This will return this cursor with a limit of ``5`` and skip of
``20`` applied. Using a slice index will override any prior
limits or skips applied to this cursor (including those
applied through previous calls to this method). Raises
:class:`IndexError` when the slice has a step, a negative
start value, or a stop value less than or equal to the start
value.
:Parameters:
- `index`: An integer or slice index to be applied to this cursor
Reimplemented from Cursor.