Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-89

return latent cursor by default, support simplest possible syntax

    • Type: Icon: Epic Epic
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.5
    • 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
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: