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

Method next

pymongo/asynchronous/cursor.py:1137–1147  ·  view source on GitHub ↗

Advance the cursor.

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

__anext__Method · 0.95

Calls 2

_supports_exhaustMethod · 0.95
_refreshMethod · 0.95

Tested by

no test coverage detected