I dokumentationen du kan se exempel på massoperationer för att infoga, uppdatera eller ta bort.
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import reactivemongo.api.bson.BSONDocument
import reactivemongo.api.bson.collection.BSONCollection
def updateWithBulk(personColl: BSONCollection) = {
// Bulk update: multiple update
val updateBuilder1 = personColl.update(ordered = true)
val updates = Future.sequence(Seq(
updateBuilder1.element(
q = BSONDocument("firstName" -> "Jane", "lastName" -> "Doh"),
u = BSONDocument("age" -> 18),
upsert = true,
multi = false),
updateBuilder1.element(
q = BSONDocument("firstName" -> "Bob"),
u = BSONDocument("age" -> 19),
upsert = false,
multi = true)))
updates.flatMap { ops => updateBuilder1.many(ops) }
}