Create a new cursor, similar to the normal :class:`~pymongo.cursor.Cursor`. Should not be called directly by application developers - see the :class:`~gridfs.GridFS` method :meth:`~gridfs.GridFS.find` instead. .. versionadded 2.7 .. seealso:: The MongoDB do
(
self,
collection: AsyncCollection[Any],
filter: Optional[Mapping[str, Any]] = None,
skip: int = 0,
limit: int = 0,
no_cursor_timeout: bool = False,
sort: Optional[Any] = None,
batch_size: int = 0,
session: Optional[AsyncClientSession] = None,
)
| 1941 | """ |
| 1942 | |
| 1943 | def __init__( |
| 1944 | self, |
| 1945 | collection: AsyncCollection[Any], |
| 1946 | filter: Optional[Mapping[str, Any]] = None, |
| 1947 | skip: int = 0, |
| 1948 | limit: int = 0, |
| 1949 | no_cursor_timeout: bool = False, |
| 1950 | sort: Optional[Any] = None, |
| 1951 | batch_size: int = 0, |
| 1952 | session: Optional[AsyncClientSession] = None, |
| 1953 | ) -> None: |
| 1954 | """Create a new cursor, similar to the normal |
| 1955 | :class:`~pymongo.cursor.Cursor`. |
| 1956 | |
| 1957 | Should not be called directly by application developers - see |
| 1958 | the :class:`~gridfs.GridFS` method :meth:`~gridfs.GridFS.find` instead. |
| 1959 | |
| 1960 | .. versionadded 2.7 |
| 1961 | |
| 1962 | .. seealso:: The MongoDB documentation on `cursors <https://dochub.mongodb.org/core/cursors>`_. |
| 1963 | """ |
| 1964 | _disallow_transactions(session) |
| 1965 | collection = _clear_entity_type_registry(collection) |
| 1966 | |
| 1967 | # Hold on to the base "fs" collection to create GridOut objects later. |
| 1968 | self._root_collection = collection |
| 1969 | |
| 1970 | super().__init__( |
| 1971 | collection.files, |
| 1972 | filter, |
| 1973 | skip=skip, |
| 1974 | limit=limit, |
| 1975 | no_cursor_timeout=no_cursor_timeout, |
| 1976 | sort=sort, |
| 1977 | batch_size=batch_size, |
| 1978 | session=session, |
| 1979 | ) |
| 1980 | |
| 1981 | async def next(self) -> AsyncGridOut: |
| 1982 | """Get next GridOut object from cursor.""" |
nothing calls this directly
no test coverage detected