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

Support sending writeConcern for commands that write

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: Public
    • Labels:
      None
    • # Replies:
      6
    • Last comment by Customer:
      false
    • Documentation Changes:
      Needed
    • SERVER fixVersion:
      3.4

      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

              Assignee:
              barrie Barrie Segal
              Reporter:
              emily.stolfo Emily Stolfo
              Participants:
              Last commenter:
              Ian Whalen
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 48 weeks, 2 days ago
                Date of 1st Reply: