WriteConcern

public enum WriteConcern: ValueConvertible

A WriteConcern describes the requested level of acknowledgement for a Write operation such as delete, update or insert.

  • Best described here: https://docs.mongodb.com/manual/reference/write-concern/

    w: When set to 1 it’ll request acknowledgement, 0 will request no acknowledgement for the Write operation When set to majority this will request acknowledgement of the majority of nodes within a cluster or replica set

    j: Acknowledgement for the completion of writing this information to the journal

    wTimeout: The time in milliseconds that’s being waited for the acknowledgement. An error will be thrown otherwise.

    Declaration

    Swift

    case custom(w: BSON.Primitive, j: Bool?, wTimeout: Int)
  • Converts this WriteConcern to a BSON.Primitive for embedding

    Declaration

    Swift

    public func makePrimitive() -> BSON.Primitive