Bulk write¶
Perform a batch of write operations in the database.
Documentation¶
Perform a batch of write operations in the database.
The batch operations are specified using the Requests input port and can contain Insert One, Update One, Update Many, Replace One, Delete One and Delete Many operations. The operations should be specified as a json-list, with each operation as an item in the list.
By adding the opt-in write_operation port, several MongoDB nodes can output a json of write operation instead of performing the operation directly. When put into a json-list, these write operations can be used as input for the Bulk write node. To produce Requests input for the Bulk write node from write_operation output ports of other nodes, use Item to List to convert the operations to a List, and use List to Json to convert the List to a json-list.
See https://docs.mongodb.com/manual/reference/method/db.collection.bulkWrite/ for more details.
For info on how to input data to MongoDB, see MongoDB data format.
Definition¶
Input ports¶
- mongodb mongodb
MongoDB
- requests json
Requests (Write operations list)
Output ports¶
- mongodb 0 - 1, mongodb
MongoDB
- batch_result json
Batch result
Configuration¶
- Ordered (ordered)
If True, perform operations in provided order. If False, perform operations in arbitrary order, possibly in parallel.
Examples¶
Implementation¶
- class node_mongodb.MongoDBBulkWrite[source]