Support Questions
Find answers, ask questions, and share your expertise

Mongo jason query is failing to execute by runMangoAggregation Processor Nifi

Solved Go to solution
Highlighted

Mongo jason query is failing to execute by runMangoAggregation Processor Nifi

Contributor

Hi Friends,

I have mongo query which running perfectly fine from mongo shell.

b.test650.aggregate(
[
{
$group: {
"_id": {
X: "$X",
Y_DT: "$Y_DT",
Z: "$Z"
},
adj: {$sum: "$adj" },
bjc: {$sum: "$bjc" },
jbc: {$sum: "$jbc" },
mnk: {$sum: "$mnk"}
}
}
]
)

 

The same query when in ran from Nifi , RunMangoAggregation  throwing out error, though the mongo aggregation query changed to json type query ...

{
"$group": {
"_id": {
"X": "$X",
"Y_DT": "$Y_DT",
"Z": "$Z"
},
"adj": {"$sum": "$adj" },
"bjc": {"$sum": "$bjc" },
"jbc": {"$sum": "$jbc" },
"mnk": {"$sum": "$mnk"}
}
}

 

Getting following error ..

error run mongodb aggregation query.: com.fasterxml.jackson.databind.exc.MismatchedInputException:ca...

 

Capture.PNG

 

 

Nifi workflow..

WorkFlow.PNG

 

Processor(runMangoAggregation) configuration

runMangoAggrigate.PNG

 

What is the change I need to do in json query which supposed to executed @ runMongoAggregation  processor?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Mongo jason query is failing to execute by runMangoAggregation Processor Nifi

Contributor

The issue is with the missing of square brackets at starting and @ ending ..

The working query is ..

[{
"$group": {
"_id": {
"X": "$X",
"Y_DT": "$Y_DT",
"Z": "$Z"
},
"adj": {"$sum": "$adj" },
"bjc": {"$sum": "$bjc" },
"jbc": {"$sum": "$jbc" },
"mnk": {"$sum": "$mnk"}
}
}]

 

View solution in original post

2 REPLIES 2
Highlighted

Re: Mongo jason query is failing to execute by runMangoAggregation Processor Nifi

Contributor

Hi friends,

Help me out get out this situation

Highlighted

Re: Mongo jason query is failing to execute by runMangoAggregation Processor Nifi

Contributor

The issue is with the missing of square brackets at starting and @ ending ..

The working query is ..

[{
"$group": {
"_id": {
"X": "$X",
"Y_DT": "$Y_DT",
"Z": "$Z"
},
"adj": {"$sum": "$adj" },
"bjc": {"$sum": "$bjc" },
"jbc": {"$sum": "$jbc" },
"mnk": {"$sum": "$mnk"}
}
}]

 

View solution in original post