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

return latent cursor by default, support simplest possible syntax

    XMLWordPrintable

    Details

    • Type: Epic
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5
    • Component/s: None
    • Labels:
      None
    • Epic Name:
      aggregate() improvements

      Description

      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
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: