PutMongoRecord 2025.10.9.21

Bundle

org.apache.nifi | nifi-mongodb-nar

Description

This processor is a record-aware processor for inserting/upserting data into MongoDB. It uses a configured record reader and schema to read an incoming record set from the body of a flowfile and then inserts/upserts batches of those records into a configured MongoDB collection. This processor does not support deletes. The number of documents to insert/upsert at a time is controlled by the “Batch Size” configuration property. This value should be set to a reasonable size to ensure that MongoDB is not overloaded with too many operations at once.

Tags

insert, mongodb, put, record, update, upsert

Input Requirement

REQUIRED

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
Mongo Collection NameThe name of the collection to use
Mongo Database NameThe name of the database to use
bypass-validationEnable or disable bypassing document schema validation during insert or update operations. Bypassing document validation is a Privilege Action in MongoDB. Enabling this property can result in authorization errors for users with limited privileges.
insert_countThe number of records to group together for one single insert/upsert operation against MongoDB.
mongo-client-serviceIf configured, this property will use the assigned client service for connection pooling.
orderedPerform ordered or unordered operations
record-readerSpecifies the Controller Service to use for parsing incoming data and determining the data’s schema
update-key-fieldsComma separated list of fields based on which to identify documents that need to be updated. If this property is set NiFi will attempt an upsert operation on all documents. If this property is not set all documents will be inserted.
update-modeChoose between updating a single document or multiple documents per incoming record.

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