UpdateOneModel
public struct UpdateOneModel : WriteModel, Decodable
A model for an updateOne
operation within a bulk write.
-
A set of filters specifying to which array elements an update should apply.
Declaration
Swift
public let arrayFilters: [Document]?
-
A collation to use.
Declaration
Swift
public let collation: Document?
-
When
true
, creates a new document if no document matches the query.Declaration
Swift
public let upsert: Bool?
-
Create an
updateOne
operation for a bulk write.Declaration
Parameters
filter
A
Document
representing the match criteria.update
A
Document
containing update operators.arrayFilters
A set of filters specifying to which array elements an update should apply.
collation
Specifies a collation to use.
upsert
When
true
, creates a new document if no document matches the query. -
Adds the
updateOne
operation to a bulk write.Throws
EncodingError
if an error occurs while encoding the options to BSON.UserError.invalidArgumentError
if the options form an invalid combination.
Declaration
Swift
public func addToBulkWrite(bulk: BulkWriteOperation, index: Int) throws