UpdateOptions
public struct UpdateOptions : Codable, BulkWriteOptionsConvertible
Options to use when executing an update
command on a MongoCollection
.
-
A set of filters specifying to which array elements an update should apply.
Declaration
Swift
public var arrayFilters: [BSONDocument]?
-
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( arrayFilters: [BSONDocument]? = nil, bypassDocumentValidation: Bool? = nil, collation: BSONDocument? = nil, hint: IndexHint? = nil, upsert: Bool? = nil, writeConcern: WriteConcern? = nil )