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

Cursors should be their own context managers.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      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()

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: