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

Method next

pymongo/synchronous/cursor.py:1135–1145  ·  view source on GitHub ↗

Advance the cursor.

(self)

Source from the content-addressed store, hash-verified

1133 return self
1134
1135 def next(self) -> _DocumentType:
1136 """Advance the cursor."""
1137 if not self._exhaust_checked:
1138 self._exhaust_checked = True
1139 self._supports_exhaust()
1140 if self._empty:
1141 raise StopIteration
1142 if len(self._data) or self._refresh():
1143 return self._data.popleft()
1144 else:
1145 raise StopIteration
1146
1147 def _next_batch(self, result: list, total: Optional[int] = None) -> bool: # type: ignore[type-arg]
1148 """Get all or some documents from the cursor."""

Callers 15

__next__Method · 0.95
test_gridfs_findMethod · 0.45
test_gridfs_findMethod · 0.45
test_snapshot_queryMethod · 0.45
test_comment_fieldMethod · 0.45
test_case_7Method · 0.45
test_iterationMethod · 0.45

Calls 2

_supports_exhaustMethod · 0.95
_refreshMethod · 0.95