acknowledgment
Describes how many nodes must acknowledge the write operation.
For the different options, see:
WriteAcknowledgment.Majority: majority of the nodes.
WriteAcknowledgment.Nodes: a given number of nodes.
WriteAcknowledgment.Tagged: specific nodes selected ahead of time.
If this field is null
(default), the MongoDB default acknowledgment applies, which is WriteAcknowledgment.Majority in most deployments.
Example
collections.updateMany(
options = {
writeConcern(WriteConcern(WriteAcknowledgment.Nodes(2))
}
) {
User::age inc 1
}
Content copied to clipboard
External resources
See also
Specify this option.