the flag to bypass document validation during the operation (default: false
)
the ordered behaviour
the writer concern to be used
Inserts many documents, according the ordered behaviour.
Inserts many documents, according the ordered behaviour.
import scala.concurrent.ExecutionContext.Implicits.global import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.BSONCollection def insertMany(coll: BSONCollection, docs: Iterable[BSONDocument]) = { val insert = coll.insert(ordered = true) insert.many(docs) // Future[MultiBulkWriteResult] }
Inserts a single document.
Inserts a single document.
import scala.concurrent.ExecutionContext.Implicits.global import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.BSONCollection def insertOne(coll: BSONCollection, doc: BSONDocument) = { val insert = coll.insert(ordered = true) insert.one(doc) }
Builder for insert operations.