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

Add CRUD API find / find_one options

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.9
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Add the following aliases:

      • spec -> filter
      • fields -> projection
      • timeout -> no_cursor_timeout
      • partial -> allow_partial_results

      Add the following new options:

      • cursor_type
      • oplog_replay
      • modifiers

      With the exception of oplog_replay, all of these new parameters will be set to None by default. If a value for any of them is provided, the following rules apply:

      A value for filter will take precedence over spec.
      A value for projection will take precedence over fields.
      A value for no_cursor_timeout will take precedence over timeout.
      A value for allow_partial_results will take precedence over partial.
      A value for cursor_type will take precedence over tailable, await_data, and exhaust.
      A value for modifiers will be used as the basis for adding modifiers to the query filter. If $snapshot or $maxScan are passed in modifiers, they will take precedence over the snapshot and max_scan options.

      Note that this should likely be enforced in pymongo.cursor.Cursor, so the the aliased options are automatically available in Collection.find_one, and can be trivially added to GridFS.find() and GridFS.find_one().

            Assignee:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: