MongoDB Remove Document

This activity is used to remove one or more documents from a collection in a MongoDB database using a JSON-like query.

Settings

Field Description
Connection Select an existing MongoDB connection from the connection list.
Operation Select from the two options: Remove One Document or Remove Many Documents from the Operation list.
Database Name Name of the database that you want to connect in the MongoDB instance.
Collection Name Name of the collection in the database.
Timeout Timeout in seconds for the activity's operations.

Input

The Input tab displays the input schema of the activity as a tree structure. You can provide the input values in the Flogo Connector for MongoDB mapping input fields directly or use Mapper to map the input values to a field from the output of a preceding activity in the flow.

The Input tab has the following fields:

Field Type Description
criteria JSON object A valid JSON that contains one or more fields that match the documents in a collection.
For example: {"_id":{"$oid":"5d91dd471c9d440000f7aba0"},"location":"Palo Alto","name":"John"}
Note: To delete all the documents in a collection, pass an empty JSON object like {} as the value for criteria and select Remove Many Documents as the Operation type in the settings tab.

Output

The Output tab displays the schema for the output data of this activity in a tree format. You can map the elements in the schema as input for the subsequent activities in the flow.

The Output tab has the following fields:
Field Description
deletedCount The number of documents that were deleted.

Loop

If you would like this activity to iterate multiple times within the flow, enter an expression that evaluates to the iteration details. Select a type of iteration from the Type menu. The default type is None, which means the activity will not iterate. Refer to the "Using the Loop Feature in an Activity" topic in the TIBCO Flogo® Enterprise.