the ordered behaviour
the writer concern to be used
Prepares an DeleteCommand.DeleteElement.
Prepares an DeleteCommand.DeleteElement.
the query/selector
the maximum number of documents
the collation
Performs a bulk operation using many deletes, each can delete multiple documents.
Performs a bulk operation using many deletes, each can delete multiple documents.
import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.BSONCollection def bulkDelete(coll: BSONCollection, docs: Iterable[BSONDocument]) = { val delete = coll.delete(ordered = true) val elements = docs.map { doc => delete.element( q = BSONDocument("filter" -> "value"), limit = Some(1)) // only first match } delete.many(elements) // Future[MultiBulkWriteResult] }
Performs a delete with a one single selector (see DeleteCommand.DeleteElement).
Performs a delete with a one single selector (see DeleteCommand.DeleteElement).
This will delete all the documents matched by the q
selector.
the query/selector
the maximum number of documents
the collation
Builder for delete operations.