Delete

../../../../_images/delete_mongodb.svg

Delete one or more documents in the database

Documentation

Delete documents from the database matching filter.

The node can be configured to perform a Delete One or a Delete Many operation. This determines if the delete should be performed on only the first or all documents matching filter.

Filter can be specified either as part of the configuration or using an opt-in json-port.

See https://docs.mongodb.com/manual/reference/method/db.collection.deleteOne/ and https://docs.mongodb.com/manual/reference/method/db.collection.deleteMany/ for more details.

For info on how to input data to MongoDB, see MongoDB data format.

This node can output a write operation, see Output write operation.

Definition

Input ports

mongodb
Type: mongodb
Description: MongoDB
filter
Type: json
Description: Filter
Optional number of ports: 0–1 (default: 0)

Output ports

mongodb
Type: mongodb
Description: MongoDB
Optional number of ports: 0–1 (default: 1)
delete_result
Type: json
Description: Delete result
Optional number of ports: 0–1 (default: 1)
write_operation
Type: json
Description: Write operation. Output write operation instead of performing the operation directly. The write operation can be used as an element in a bulk write input list
Optional number of ports: 0–1 (default: 0)

Configuration

Filter (filter)

Filter as json.

Operation (operation)

Operation used for updating.

Implementation

class node_mongodb.MongoDBDelete[source]