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

Method rewind

pymongo/synchronous/cursor.py:1117–1133  ·  view source on GitHub ↗

Rewind this cursor to its unevaluated state. Reset this cursor if it has been partially or completely evaluated. Any options that are present on the cursor will remain in effect. Future iterating performed on this cursor will cause new queries to be sent to the serve

(self)

Source from the content-addressed store, hash-verified

1115 return len(self._data)
1116
1117 def rewind(self) -> Cursor[_DocumentType]:
1118 """Rewind this cursor to its unevaluated state.
1119
1120 Reset this cursor if it has been partially or completely evaluated.
1121 Any options that are present on the cursor will remain in effect.
1122 Future iterating performed on this cursor will cause new queries to
1123 be sent to the server, even if the resultant data has already been
1124 retrieved by this cursor.
1125 """
1126 self.close()
1127 self._data = deque()
1128 self._id = None
1129 self._address = None
1130 self._retrieved = 0
1131 self._killed = False
1132
1133 return self
1134
1135 def next(self) -> _DocumentType:
1136 """Advance the cursor."""

Callers 10

test_gridfs_findMethod · 0.45
test_gridfs_findMethod · 0.45
test_rewindMethod · 0.45
test_cloneMethod · 0.45
test_tailableMethod · 0.45
test_gridfs_findMethod · 0.45
test_gridfs_findMethod · 0.45
test_rewindMethod · 0.45
test_cloneMethod · 0.45
test_tailableMethod · 0.45

Calls 1

closeMethod · 0.45

Tested by 10

test_gridfs_findMethod · 0.36
test_gridfs_findMethod · 0.36
test_rewindMethod · 0.36
test_cloneMethod · 0.36
test_tailableMethod · 0.36
test_gridfs_findMethod · 0.36
test_gridfs_findMethod · 0.36
test_rewindMethod · 0.36
test_cloneMethod · 0.36
test_tailableMethod · 0.36