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

Allow filter by ObjectId for `update_one()` and other methods

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Unknown
    • Resolution: Won't Fix
    • None
    • None
    • API
    • None

    Description

      Regarding the filter for methods like `update_one()`, etc, allow users to directly use `ObjectId()` as filter

       

      Usually it is used like:

      db.collection.update_one({'_id': ObjectId('6ef...d32')}, ...) 

       

      Proposed: To allow API usage like this:

      db.collection.update_one(ObjectId('6ef...d32'), ...)

      Also, the method `find_one()` allows for this style
      collection.py

      Attachments

        Activity

          People

            Unassigned Unassigned
            souryavarenya@gmail.com Sourya Kovvali
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: