PutMongo 2025.10.9.21

Bundle

org.apache.nifi | nifi-mongodb-nar

Description

Writes the contents of a FlowFile to MongoDB

Tags

insert, mongodb, put, update, write

Input Requirement

REQUIRED

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
Character SetThe Character Set in which the data is encoded
ModeIndicates whether the processor should insert or update content
Mongo Collection NameThe name of the collection to use
Mongo Database NameThe name of the database to use
Update MethodMongoDB method for running collection update operations, such as updateOne or updateMany
Update Query KeyOne or more comma-separated document key names used to build the update query criteria, such as _id
UpsertWhen 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
mongo-client-serviceIf configured, this property will use the assigned client service for connection pooling.
put-mongo-update-modeChoose 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.
putmongo-update-querySpecify 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.

Relationships

NameDescription
failureAll FlowFiles that cannot be written to MongoDB are routed to this relationship
successAll FlowFiles that are written to MongoDB are routed to this relationship

Writes attributes

NameDescription
mongo.put.update.match.countThe match count from result if update/upsert is performed, otherwise not set.
mongo.put.update.modify.countThe modify count from result if update/upsert is performed, otherwise not set.
mongo.put.upsert.idThe ‘_id’ hex value if upsert is performed, otherwise not set.