-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
Allow find/aggregate cursors to be used in async with-statements. Reported here: https://github.com/mongodb/motor/pull/172
When I use the following code:
async with self.coll.find() as cursor: async for record in cursor: yield recordIt's going to throw an AttributeError.
So I added the asynchronous context manager method so that I did not have to close the cursor when I was done with it