Understanding the Write Concern
Before connecting to and updating data on a MongoDB server, you need to decide what level of write concern you want to implement on your connection. A write concern is the guarantee that the MongoDB connection provides when reporting on the success of a write operation. The strength of a write concern determines the level of guarantee.
The basic idea is that stronger write concerns tell MongoDB to wait until a write has successfully been written to disk before responding. On the other hand, a weaker write concern may only wait until MongoDB has successfully scheduled a change to be written before responding. The downside of stronger write concerns is that the stronger they are, the longer MongoDB waits to respond ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access