Add ability to iterate all documents in a tailable cursor in a single for loop.

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Do
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Iterating all documents in a tailable cursor currently requires multiple for loops:

      while tailable_cursor.alive:
          for doc in tailable_cursor:
              print(doc)
          print('getMore returned 0 documents') 
      

      It would be nice if there was a way to iterate all the documents in a single loop:

      for doc in tailable_cursor:
          print(doc)
      

      However, we can't make this the default behavior because applications may rely on breaking out of the loop.

            Assignee:
            Unassigned
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: