[JAVA-2221] Always send writeConcern for commands that write Created: 10/Jun/16  Updated: 19/Oct/16  Resolved: 26/Jul/16

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: None
Fix Version/s: 3.4.0

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-290 Support sending writeConcern for comm... Closed
Epic Link: MongoDB 3.4 for Java driver

 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. The list is ordered according to likelihood that a driver has a helper for the command.

  • aggregate with $out
  • copydb
  • create
  • createIndexes
  • drop
  • dropDatabase
  • dropIndexes
  • mapReduce with $out
  • clone
  • cloneCollection
  • cloneCollectionAsCapped
  • collMod
  • convertToCapped
  • emptyCapped
  • renameCollection
  • appendoplognote
  • godInsert
  • capTrunc
  • reindex
    * mergechunk


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.



 Comments   
Comment by Githook User [ 26/Jul/16 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-2221: Add write concern to commands that write, including:

Generated at Thu Feb 08 08:56:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.