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

Support sending writeConcern for commands that write

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      When talking with server 3.4 or greater (maxWireVersion >=5), writeConcern should be a supported option for commands that write.
      Helpers for the following commands therefore must be updated to support the option.

      These are commands that newly accept a writeConcern as of 3.4, for which driver helpers should be updated:

      • aggregate with $out
      • clone
      • cloneCollection
      • cloneCollectionAsCapped
      • collMod
      • convertToCapped
      • copydb
      • create
      • createIndexes
      • drop
      • dropDatabase
      • dropIndexes
      • reindex
      • mapReduce with out
      • renameCollection

      Note:

      When the writeConcern on a command that writes fails, the resulting document still comes back with ok: 1. 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.
      See the specs here for details on writeConcern with the generic command method. See the specs here for details on handling writeConcern with command helpers.

      Attachments

        Issue Links

          Activity

            People

              barrie Barrie Segal
              emily.stolfo Emily Stolfo
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: