Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

Query MongoDB with Nifi

I am sending customer Id to MongoDB with Nifi and want to query MongoDB for this customer.

How do i extract data from another processor, query db and send it to next processor?

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In the GetMongo processor, you can specify a Query. If you leave it blank, the processor will look in the input FlowFile's for the query, so you must transform your Kafka messages to valid MongoDB queries in JSON format.

Alternatively, you can use the MongoDBLookupService directly. It will translate key-value pairs in the incoming record to valid MongoDB queries automatically.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...