Search code examples
mongodbapache-nifi

How do I assign array of Objects as value to an Attribute in Apache NiFi


In Apache NiFi, My Mongo DB is returning Array of Objects as shown below

   [ 
     { fname:john,  
      city:Nyc 
      },
     { lname:doe,
      city:Nj
     }
   ]

I am trying to assign the entire array of Objects to an Attrbiute using EvaluateJsonPath Processor,

my EvaluateJsonPath configuration is as shown below,but I am getting "EvaluateJsonPath unable to return a scalar" error.

I tried $.* in fullname value, tried changing return type to Scalar and auto detect. still I am getting the same error.

enter image description here

How do I assign the entire array of objects to an attribute in Apache NiFi


Solution

  • In case,if any one is interested

    Changing Return type to Json and Fullname value to $.* resolved the issue.