ReplaceOptions
public struct ReplaceOptions : Codable, BulkWriteOptionsConvertible
Options to use when executing a replace
command on a MongoCollection
.
-
If true, allows the write to opt-out of document level validation.
Declaration
Swift
public var bypassDocumentValidation: Bool?
-
Specifies a collation.
Declaration
Swift
public var collation: BSONDocument?
-
A document or string that specifies the index to use to support the query. Only supported in server 4.2+.
Declaration
Swift
public var hint: IndexHint?
-
When true, creates a new document if no document matches the query.
Declaration
Swift
public var upsert: Bool?
-
An optional
WriteConcern
to use for the command.Declaration
Swift
public var writeConcern: WriteConcern?
-
Convenience initializer allowing any/all parameters to be optional
Declaration
Swift
public init( bypassDocumentValidation: Bool? = nil, collation: BSONDocument? = nil, hint: IndexHint? = nil, upsert: Bool? = nil, writeConcern: WriteConcern? = nil )