WriteModel
public enum WriteModel<CollectionType> where CollectionType : Decodable, CollectionType : Encodable
Enum encompassing operations that can be run as part of a bulkWrite
.
-
A
deleteOne
. Parameters:- A
BSONDocument
representing the match criteria. options
: OptionalDeleteModelOptions
.
Declaration
Swift
case deleteOne(BSONDocument, options: DeleteModelOptions? = nil)
- A
-
A
deleteMany
. Parameters:- A
BSONDocument
representing the match criteria. options
: OptionalDeleteModelOptions
.
Declaration
Swift
case deleteMany(BSONDocument, options: DeleteModelOptions? = nil)
- A
-
An
insertOne
. Parameters:- A
T
to insert.
Declaration
Swift
case insertOne(CollectionType)
- A
-
A
replaceOne
. Parameters:filter
: ABSONDocument
representing the match criteria.replacement
: AT
to use as the replacement value.options
: OptionalReplaceOneModelOptions
.
Declaration
Swift
case replaceOne(filter: BSONDocument, replacement: CollectionType, options: ReplaceOneModelOptions? = nil)
-
An
updateOne
. Parameters:filter
: ABSONDocument
representing the match criteria.update
: ABSONDocument
containing update operators.options
: OptionalUpdateModelOptions
.
Declaration
Swift
case updateOne(filter: BSONDocument, update: BSONDocument, options: UpdateModelOptions? = nil)
-
An
updateMany
. Parameters:filter
: ABSONDocument
representing the match criteria.update
: ABSONDocument
containing update operators.options
: OptionalUpdateModelOptions
.
Declaration
Swift
case updateMany(filter: BSONDocument, update: BSONDocument, options: UpdateModelOptions? = nil)