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

Commands shouldn't use Collection.find()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.0
    • None
    • None

    Description

      The current implementation of Database.command calls Collection.find() under the covers and iterated the resulting instance of Cursor to retrieve the command result. This seems to be a case of DRY gone off the rails. Command helpers on the Collection and Cursor classes also call back to Database.command, which then calls Collection.find(), creating another Cursor, etc. This is highly inefficient and leads to internal driver behavior that is difficult to reason about.

      PyMongo 3.0 will have a simplified command implementation that bypasses Collection.find().

      Attachments

        Activity

          People

            bernie@mongodb.com Bernie Hackett
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: