MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / __next__

Method __next__

mongoengine/queryset/base.py:1641–1659  ·  view source on GitHub ↗

Wrap the result in a :class:`~mongoengine.Document` object.

(self)

Source from the content-addressed store, hash-verified

1639 # Iterator helpers
1640
1641 def __next__(self):
1642 """Wrap the result in a :class:`~mongoengine.Document` object."""
1643 if self._none or self._empty:
1644 raise StopIteration
1645
1646 raw_doc = next(self._cursor)
1647
1648 if self._as_pymongo:
1649 return raw_doc
1650
1651 doc = self._document._from_son(
1652 raw_doc,
1653 _auto_dereference=self._auto_dereference,
1654 )
1655
1656 if self._scalar:
1657 return self._get_scalar(doc)
1658
1659 return doc
1660
1661 def rewind(self):
1662 """Rewind the cursor to its unevaluated state."""

Callers

nothing calls this directly

Calls 2

_get_scalarMethod · 0.95
_from_sonMethod · 0.80

Tested by

no test coverage detected