WriteConcern
public struct WriteConcern : Codable
extension WriteConcern: CustomStringConvertible
extension WriteConcern: Equatable
A class to represent a MongoDB write concern.
-
An option to request acknowledgement that the write operation has propagated to specified mongod instances.
See moreDeclaration
Swift
public enum W : Codable, Equatable
-
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
InvalidArgumentError
if the options form an invalid combination.
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