Nodes

data class Nodes(val count: Int) : WriteAcknowledgment(source)

Requests acknowledgment that the write operation has propagated to the specified number of instances.

If set to 1, the write operation must be acknowledged by the standalone mongod or by the primary in a replica set. The data may be rolled back if the primary steps down before the write has replicated to secondaries.

If set to 0, no acknowledgment about the write itself are requested. However, the client may still receive transport exceptions (e.g. networking errors). The data may be rolled back if the primary steps down before the write has replicated to secondaries.

If WriteConcern.writeToJournal is true, the request will acknowledge that it has been written to the journal, meaning that at least one node will acknowledge the write, even if this option is set to 0.

If set to a number greater than 1, the primary must acknowledge the request, as well as as many data-bearing secondaries as needed to meet the specified write concern. That is, 2 requests acknowledgment from the primary and one secondary.

External resources

See also

Specify this option.

Constructors

Link copied to clipboard
constructor(count: Int)

Properties

Link copied to clipboard
val count: Int

See Nodes.