insert
Inserts documents into a MongoDB collection using a flow of documents.
Return
A flow of InsertOneResult objects.
Example usage:
val collection = // new MongoCollection<Document>
val documentsFlow = flowOf(Document("field" to "value"))
collection.insert(documentsFlow).collect { result -> println("Document inserted: ${result.insertedId}") }
Content copied to clipboard
Parameters
flow
The flow of documents to insert.
concurrency
The concurrency for this operation. Defaults to 1.