DeleteManyModel

public struct DeleteManyModel : WriteModel, Decodable

A model for a deleteMany operation within a bulk write.

  • A Document representing the match criteria.

    Declaration

    Swift

    public let filter: Document
  • The collation to use.

    Declaration

    Swift

    public let collation: Document?
  • Create a deleteMany operation for a bulk write.

    Declaration

    Swift

    public init(_ filter: Document, collation: Document? = nil)

    Parameters

    filter

    A Document representing the match criteria.

    collation

    Specifies a collation to use.

  • Adds the deleteMany operation to a bulk write.

    Throws

    • UserError.invalidArgumentError if the options form an invalid combination.
    • EncodingError if an error occurs while encoding the options to BSON.

    Declaration

    Swift

    public func addToBulkWrite(bulk: BulkWriteOperation, index: Int) throws