PutMongo
Description
Writes the contents of a FlowFile to MongoDB
Tags
insert, mongodb, put, update, write
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Client Service | mongo-client-service | Controller Service: MongoDBClientService Implementations: MongoDBControllerService | If configured, this property will use the assigned client service for connection pooling. | |
Mongo Database Name * | Mongo Database Name | The name of the database to use Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Mongo Collection Name * | Mongo Collection Name | The name of the collection to use Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Mode * | Mode | insert |
| Indicates whether the processor should insert or update content |
Upsert * | Upsert | false |
| When true, inserts a document if no document matches the update query criteria; this property is valid only when using update mode, otherwise it is ignored This property is only considered if:
|
Update Query Key | Update Query Key | One or more comma-separated document key names used to build the update query criteria, such as _id Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| ||
Update Query | putmongo-update-query | Specify a full MongoDB query to be used for the lookup query to do an update/upsert. NOTE: this field is ignored if the 'Update Query Key' value is not empty. Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| ||
Update Mode * | put-mongo-update-mode | With whole document |
| Choose an update mode. You can either supply a JSON document to use as a direct replacement or specify a document that contains update operators like $set, $unset, and $inc. When Operators mode is enabled, the flowfile content is expected to be the operator part for example: {$set:{"key": "value"},$inc:{"count":1234}} and the update query will come from the configured Update Query property. This property is only considered if:
|
Update Method | Update Method | Update One |
| MongoDB method for running collection update operations, such as updateOne or updateMany This property is only considered if:
|
Character Set * | Character Set | UTF-8 | The Character Set in which the data is encoded |
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
failure | All FlowFiles that cannot be written to MongoDB are routed to this relationship |
success | All FlowFiles that are written to MongoDB are routed to this relationship |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
mongo.put.update.match.count | The match count from result if update/upsert is performed, otherwise not set. |
mongo.put.update.modify.count | The modify count from result if update/upsert is performed, otherwise not set. |
mongo.put.upsert.id | The '_id' hex value if upsert is performed, otherwise not set. |
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
Scope | Description |
---|---|
MEMORY | An instance of this component can cause high usage of this system resource. Multiple instances or high concurrency settings may result a degradation of performance. |