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

The doc should clarify that the resulting documents that are produced with upserts are constructed from both the filter and the update params

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Trivial - P5
    • Resolution: Fixed
    • None
    • 4.2
    • Docs

    Description

      The PyMongo documentation didn't make it clear that a resulting document produced in an upser would be constructed from both the filter and the update parameters passed into the method.

      For comparison, the server doc is pretty clear in that regard:

      If upsert: true and no documents match the filter, db.collection.updateOne() creates a new document based on the filter criteria and update modifications.

      Attachments

        Activity

          People

            julius.park@mongodb.com Julius Park (Inactive)
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: