WriteConcern

public class WriteConcern : Codable

A class to represent a MongoDB write concern.

  • W

    An option to request acknowledgement that the write operation has propagated to specified mongod instances.

    See more

    Declaration

    Swift

    public enum W : Codable, Equatable
  • w

    Indicates the W value for this WriteConcern.

    Declaration

    Swift

    public var w: W? { get }
  • Indicates whether to wait for the write operation to get committed to the journal.

    Declaration

    Swift

    public var journal: Bool? { get }
  • If the write concern is not satisfied within this timeout (in milliseconds), the operation will return an error. The value MUST be greater than or equal to 0.

    Declaration

    Swift

    public var wtimeoutMS: Int64? { get }
  • Indicates whether this is an acknowledged write concern.

    Declaration

    Swift

    public var isAcknowledged: Bool { get }
  • Indicates whether this is the default write concern.

    Declaration

    Swift

    public var isDefault: Bool { get }
  • Initializes a new, empty WriteConcern.

    Declaration

    Swift

    public init()
  • Initializes a new WriteConcern.

    Throws

    • UserError.invalidArgumentError if the options form an invalid combination.

    Declaration

    Swift

    public init(journal: Bool? = nil, w: W? = nil, wtimeoutMS: Int64? = nil) throws
  • Declaration

    Swift

    public required convenience init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Returns the relaxed extended JSON representation of this WriteConcern. On error, an empty string will be returned.

    Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public static func == (lhs: WriteConcern, rhs: WriteConcern) -> Bool