Mongo.BulkWrite.write
You're seeing just the function
write
, go back to Mongo.BulkWrite module for more information.
Specs
write( GenServer.server(), Mongo.UnorderedBulk.t() | Mongo.OrderedBulk.t(), Keyword.t() ) :: Mongo.BulkWriteResult.t()
Executes unordered and ordered bulk writes.
Unordered bulk writes
The operation are grouped (inserts, updates, deletes). The order of execution is:
- inserts
- updates
- deletes
The execution order within the group is not preserved.
Ordered bulk writes
Sequences of the same operations are grouped and sent as one command. The order is preserved.
If a group (inserts, updates or deletes) exceeds the limit maxWriteBatchSize
it will be split into chunks.
Everything is done in memory, so this use case is limited by memory. A better approach seems to use streaming bulk writes.