Cursors should be their own context managers.

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 2.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      this way you can guarantee a cursor gets closed w/o waiting for it to get GC'ed, etc.

      with db.test.find() as cursor:
      cursor.next()

              Assignee:
              Bernie Hackett
              Reporter:
              Michael Dirolf (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: