Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-39

Cursors should be their own context managers.

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Bernie Hackett
            Reporter:
            mike Michael Dirolf
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: