MongoDB Documentation, Release 3.0.4 Write Concern Considerations Write Concern Levels Write concern describes the guarantee that MongoDB provides when reporting on the success of a write operation. The strength of the write concerns determine the level of guarantee. When inserts, updates and deletes have a weak write concern, write operations return quickly. In some failure cases, write operations issued with weak write concerns may not persist. With stronger write concerns, clients wait after sending a write operation for MongoDB to confirm the write operations. MongoDB provides different levels of write concern to better address the specific needs of applications. Clients may adjust write concern to ensure that the most important operations persist successfully to an entire MongoDB deployment. For other less critical operations, clients can adjust the write concern to ensure faster performance rather than ensure persistence to the entire deployment. Changed in version 2.6: A new protocol for write operations (page 852) integrates write concern with the write operations. For details on write concern configurations, see Write Concern Reference (page 130). Default Write Concern The mongo shell and the MongoDB drivers use Acknowledged (page 78) as the default write concern. See Acknowledged (page 78) for more information, including when this write concern became the default. Timeouts Clients can set a wtimeout (page 131) value as part of a replica acknowledged (page 80) write concern. If the write concern is not satisfied in the specified interval, the operation returns an error, even if the write concern will eventually succeed. MongoDB does not “rollback” or undo modifications made before the wtimeout interval expired. MongoDB has the following levels of conceptual write concern, listed from weakest to strongest: Unacknowledged With an unacknowledged write concern, MongoDB does not acknowledge the receipt of write operations. Unacknowledged is similar to errors ignored ; however, drivers will attempt to receive and handle network errors when possible. The driver’s ability to detect network errors depends on the system’s networking configuration. Before the releases outlined in Default Write Concern Change (page 924), this was the default write concern. Acknowledged With a receipt acknowledged write concern, the mongod confirms that it received the write oper- ation and applied the change to the in-memory view of data. Acknowledged write concern allows clients to catch network, duplicate key, and other errors. MongoDB uses the acknowledged write concern by default starting in the driver releases outlined in Releases (page 924). Changed in version 2.6: The mongo shell write methods now incorporates the write concern (page 78) in the write methods and provide the default write concern whether run interactively or in a script. See Write Method Acknowl- edgements (page 857) for details. Acknowledged write concern does not confirm that the write operation has persisted to the disk system. Chapter 3. MongoDB CRUD Operations 78