WriteConcern

public struct WriteConcern : Codable
extension WriteConcern: CustomStringConvertible
extension WriteConcern: Equatable

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 let w: W?
  • Indicates whether to wait for the write operation to get committed to the journal.

    Declaration

    Swift

    public let journal: Bool?
  • 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 let wtimeoutMS: Int64?
  • 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

    Declaration

    Swift

    public init(journal: Bool? = nil, w: W? = nil, wtimeoutMS: Int64? = nil) 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