-
Type: Epic
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Done
-
aggregate() improvements
Motor with Tornado currently requires:
cursor = yield collection.aggregate(pipeline, cursor={})
while (yield cursor.fetch_next):
doc = cursor.next_object()
In asyncio, the same with "yield from". This should be possible instead:
cursor = collection.aggregate(pipeline)
while (yield cursor.fetch_next):
doc = cursor.next_object()
Same in asyncio, again with "yield from".
In Python 3.5, using asyncio or Tornado:
async for doc in collection.aggregate(pipeline):
pass