Skip to main content
Amn
Silver ⭐️
May 27, 2021 12:01 PM UTC
Solved

NIFI GetMongo Dynamic Query Creation

Hi,

 

I am trying to create query with attribute value in getMongo.

 

My attribute is itemType, i want to create query using this.

 

{

"itemType": ${itemType}

}

 

if i put hard code value there instead of ${itemType} it works

MattWho
MattWhoAnswer
Titanium ⭐️⭐️
May 28, 2021 4:23 PM UTC

@Amn 

Where did you define the NiFi Attribute "${itemType}" (FlowFile Attribute on a source FlowFile driving execution of GetMongo processor or NiFi variable registry)?

MattWho_0-1622218915953.png

NiFi is also case sensitive, so for example "ItemType" and "itemType" would be considered different variables.

If you found this helpful to yoru query, please take a moment to login and click "Accept" on this solution.
Thank you,

Matt

1 reply

MattWho
Titanium ⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️
May 28, 2021 4:23 PM UTC

@Amn 

Where did you define the NiFi Attribute "${itemType}" (FlowFile Attribute on a source FlowFile driving execution of GetMongo processor or NiFi variable registry)?

MattWho_0-1622218915953.png

NiFi is also case sensitive, so for example "ItemType" and "itemType" would be considered different variables.

If you found this helpful to yoru query, please take a moment to login and click "Accept" on this solution.
Thank you,

Matt

Translate