Description and usage of DeleteMongo processor:

Executes a delete query against a MongoDB collection. The query is provided in the body of the flowfile and the user can select whether it will delete one or many documents that match it.

Tags:

delete, mongo, mongodb

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the Expression Language Guide.

Name

Default Value

Allowable Values

Description

Client Service

Controller Service API: 


MongoDBClientService

Implementation: 

MongoDBControllerService


If configured, this property will use the assigned client service for connection pooling.
Mongo URI MongoURI, typically of the form: mongodb://host1[:port1][,host2[:port2],...]

Supports Expression Language: true (will be evaluated using variable registry only)


Mongo Database Name

The name of the database to use

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Mongo Collection Name

The name of the collection to use

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


SSL Context Service

Controller Service API: 


SSLContextService

Implementations: 

StandardRestrictedSSLContextService


StandardSSLContextService


The SSL Context Service used to provide client certificate information for TLS/SSL connections.
Client Auth REQUIRED * WANT
* REQUIRED
* NONE
Client authentication policy when connecting to secure (TLS/SSL) cluster. Possible values are REQUIRED, WANT, NONE. This property is only used when an SSL Context has been defined and enabled.
Delete Mode one * Delete One 
* Delete Many 
* Use 'mongodb.delete.mode' attribute 
Choose between deleting one document by query or many documents by query.
Fail When Nothing Is Deleted true * True 
* False 
Determines whether to send the flowfile to the success or failure relationship if nothing is successfully deleted.

Write Concern

ACKNOWLEDGED * ACKNOWLEDGED
* UNACKNOWLEDGED
* FSYNCED
* JOURNALED
* REPLICA_ACKNOWLEDGED
* MAJORITY
The write concern to use

Relationships:

Name

Description

success All FlowFiles that are written to MongoDB are routed to this relationship
failure All FlowFiles that cannot be written to MongoDB are routed to this relationship

Reads Attributes:

Name

Description

mongodb.delete.mode Configurable parameter for controlling delete mode on a per-flowfile basis. The process must be configured to use this option. Acceptable values are 'one' and 'many.'

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.

Summary

This processor deletes from Mongo using a user-provided query that is provided in the body of a flowfile. It must be a valid JSON document. The user has the option of deleting a single document or all documents that match the criteria. That behavior can be configured using the related configuration property. In addition, the processor can be configured to regard a failure to delete any documents as an error event, which would send the flowfile with the query to the failure relationship.

Example Query

{
"username": "john.smith",
"recipient": "jane.doe"
}