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

Commands shouldn't use Collection.find()

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

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

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

              Created:
              Updated:
              Resolved: