Search code examples
mongodbapache-nifi

Nifi PutMongo - How to insert document into MongoDB using attribute values of Flow File but not Flow File content?


I am trying to insert a document into mongodb using apache NiFi. I want to insert a document just from Flow File attributes but not the Flow File content.

I have tried using PutMongo processor but it insert the content of the Flow file which I don't want it to insert. I need to insert a custom document by using the flow file's attributes.


Solution

  • You can use a processor like AttributesToJson, or ReplaceText, to overwrite the flow file content with the attributes that you want to use for the Mongo document.