Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-224

Implement findAndModify writeConcern support

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • None
    • None

    Description

      The Write Concern specification details the specifics of adding write concern to your driver for findAndModify.

      In short, when talking with server 3.2 or greater (maxWireVersion >=4), writeConcern should be added to the findAndModify command used from the CRUD spec helper methods findOneAndUpdate, findOneAndReplace, and findOneAndDelete.

      Important Note:

      When the writeConcern on findAndModify fails, the resulting document still comes back with ok: 1. This is the same as the write commands. Hence, to check for write concern and raise the appropriate error to your users, you will need to check the resulting document for a writeConcernError field. If it is present, then writeConcern failed.

      Attachments

        Issue Links

          Activity

            People

              barrie Barrie Segal
              david.golden@mongodb.com David Golden
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: