MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / skip

Method skip

pymongo/synchronous/cursor.py:468–486  ·  view source on GitHub ↗

Skips the first `skip` results of this cursor. Raises :exc:`TypeError` if `skip` is not an integer. Raises :exc:`ValueError` if `skip` is less than ``0``. Raises :exc:`~pymongo.errors.InvalidOperation` if this :class:`Cursor` has already been used. The last `skip` ap

(self, skip: int)

Source from the content-addressed store, hash-verified

466 return self
467
468 def skip(self, skip: int) -> Cursor[_DocumentType]:
469 """Skips the first `skip` results of this cursor.
470
471 Raises :exc:`TypeError` if `skip` is not an integer. Raises
472 :exc:`ValueError` if `skip` is less than ``0``. Raises
473 :exc:`~pymongo.errors.InvalidOperation` if this :class:`Cursor` has
474 already been used. The last `skip` applied to this cursor takes
475 precedence.
476
477 :param skip: the number of results to skip
478 """
479 if not isinstance(skip, int):
480 raise TypeError(f"skip must be an integer, not {type(skip)}")
481 if skip < 0:
482 raise ValueError("skip must be >= 0")
483 self._check_okay_to_chain()
484
485 self._skip = skip
486 return self
487
488 def max_time_ms(self, max_time_ms: Optional[int]) -> Cursor[_DocumentType]:
489 """Specifies a time limit for a query operation. If the specified

Callers 13

get_versionMethod · 0.45
get_versionMethod · 0.45
test_gridfs_findMethod · 0.45
test_skipMethod · 0.45
test_gridfs_findMethod · 0.45
test_skipMethod · 0.45

Calls 1

_check_okay_to_chainMethod · 0.95

Tested by 8

test_gridfs_findMethod · 0.36
test_skipMethod · 0.36
test_gridfs_findMethod · 0.36
test_skipMethod · 0.36