suspend fun <T : Any> MongoCollection<T>.insertMany(documents: List<T>, options: InsertManyOptions = InsertManyOptions()): Void?
(source)
Inserts one or more documents. A call to this method is equivalent to a call to the {@code bulkWrite} method
documents
- the documents to insert
options
- the options to apply to the operation
com.mongodb.MongoBulkWriteException
- if there's an exception in the bulk write operation
com.mongodb.MongoException
- if the write failed due some other failure
See Also
com.mongodb.async.client.MongoCollection
suspend fun <T : Any> MongoCollection<T>.insertMany(clientSession: ClientSession, documents: List<T>, options: InsertManyOptions = InsertManyOptions()): Void?
(source)
Inserts one or more documents. A call to this method is equivalent to a call to the {@code bulkWrite} method
clientSession
- the client session with which to associate this operation
documents
- the documents to insert
options
- the options to apply to the operation
com.mongodb.MongoBulkWriteException
- if there's an exception in the bulk write operation
com.mongodb.MongoException
- if the write failed due some other failure
See Also