Articles → MONGODB → Write Concern In MongoDB
Write Concern In MongoDB
Purpose
Syntax
db.[Table_name].insertOne(
{
[inserted_document]
},
{
writeConcern:
{
w:[value],
j=[true/false],
wtimeout=[timeout value]
}
})
| Attribute | Description |
|---|
| w | Request acknowledgment that the write operation has propagated to a specified number of MongoDB instances. |
| j | Request acknowledgment that the write operation has been written to the on-disk journal. |
| wtimeout | Specify a time limit to prevent write operations from blocking indefinitely. |
Example
| Posted By - | Karan Gupta |
| |
| Posted On - | Wednesday, November 22, 2023 |