Created on 07-02-2020 07:37 AM - edited 07-02-2020 07:38 AM
Hello,
I have a piece of JSON on which I want to apply an updateRecord processor using some filter capabilities. My JSON looks like this:
"status": [
{
"code": "InProgress",
"isCurrentStatus": false,
"startDateTime": "2020-03-05T20:45:00Z"
},
{
"code": "Pending",
"isCurrentStatus": true,
"startDateTime": "2020-03-05T21:20:00Z"
}
],
And my RecordPath expression is the following:
/status[0..-1][./isCurrentStatus = true]/code
This expression doesn't work and I have an error in my logs file stating about incorrect syntax: Unexpected token ']' at line 1
If I put the following syntax:
/status[0..-1][./isCurrentStatus = "true"]/code
it doesn't give anymore error, but of course the filter doesn't work. So, I have the feeling that recordPath filter doesn't support the use of boolean values.
My Nifi is Nifi 1.9.0 coming with HDF 3.4.
Any idea?
Thanks a lot,
Stéphane
Created 07-10-2020 08:42 AM
Answer to myself: I solved the problem by converting this boolean to string using Jolt:
{
"operation": "modify-overwrite-beta",
"spec": {
"status": {
"*": {
"isCurrentStatus": "=toString"
}
}
}
}
Created 07-10-2020 08:42 AM
Answer to myself: I solved the problem by converting this boolean to string using Jolt:
{
"operation": "modify-overwrite-beta",
"spec": {
"status": {
"*": {
"isCurrentStatus": "=toString"
}
}
}
}
Created 07-10-2020 11:47 AM
I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.