Write Concern
|
Yes
|
Select an assurance that MongoDB provides when it reports on the success of a write operation.
Note: The strength of a write concern determines the level of an assurance. When the plug-in performs a write operation with a weak write concern, the write operation is returned quickly. While the plug-in performs a write operation with a strong write concern, the client has to wait for the MongoDB to confirm the write operation before reporting the result of the operation.
Select a write concern from the following list, ranked from the weakest to the strongest:
- UNACKNOWLEDGED
With an unacknowledged write concern, MongoDB does not acknowledge the receipt of a write operation and the write operation is returned as soon as the message is written to the socket. Only network errors are captured and handled.
- ACKNOWLEDGED
With a receipt acknowledged write concern, a write operation waits for an acknowledgment from the primary server before returning a result. Network, duplicate key, and other errors are captured and handled.
- JOURNALED
With a journaled write concern, MongoDB acknowledges a write operation after committing the data to the journal. Both network issues and server errors are captured and handled. This type of write concern ensures that MongoDB can recover the data if there is a shutdown or power interruption emergency. Before using this type of write concern, you must have journaling enabled.
- FSYNCED
With a fsynced write concern, a write operation waits for the server to flush data to the disk before returning a result. Network, duplicate key, and other errors are captured and handled.
- REPLICA_ACKNOWLEDGED
With a replica acknowledged write concern, a write operation waits for acknowledgments from at least 2 servers before returning a result. Network, duplicate key, and other errors are captured and handled.
- MAJORITY
With a majority write concern, a write operation waits for acknowledgments from a majority of servers before returning a result. Network, duplicate key, and other errors are captured and handled.
|