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

Can't force PyMongo to send w=1 write concern

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8, 3.0
    • Affects Version/s: None
    • Component/s: None
    • None

      By default, PyMongo correctly calls the "insert" command with no writeConcern, and calls getLastError with no "w" argument.

      But PyMongo should include writeConcern of "w=1" with the insert command, or call getLastError with "w=1", if configured like this:

      MongoClient('mongodb://localhost?w=1').db.collection.insert({})
      

      Or if called like this:

      collection.insert({}, w=1)
      

      The purpose of sending w=1 is to override getLastErrorDefaults. Since getLastErrorDefaults are rarely, if ever, configured, this is a low-priority bug.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: