Hello there,
I'm trying to get a list of strings without null values, but I can't get the result that I want.
I've tried it in two different ways:
WITH 'recursivo.json' AS json_file
CALL apoc.load.json(json_file, "$..id_requisito") YIELD value AS result
with json_file, result.result AS keys
return keys
This was the first one and the result I got was this:
The other way is this:
WITH 'recursivo.json' AS json_file
CALL apoc.load.json(json_file) YIELD value AS result
with json_file, result.id_requisito AS keys
return keys
And the result:
If you want to know what's the JSON file:
[
{
"id_requisito" : "R1",
"sentence" : {
"operator": "&&",
"left" : "H",
"right" : {
"operator" : "&&",
"left" : "A",
"right" : {
"operator" : "||",
"left" : "B",
"right" : "C"
}
}
}
},
{
"id_requisito" : "R2",
"sentence" : {
"operator": "||",
"left" : "A",
"right" : "B"
}
},
{
"id_requisito" : "R3",
"sentence" : {
"operator": "&&",
"left" : {
"operator" : "||",
"left" : "A",
"right" : "B"
},
"right" : "C"
}
}
]
It would be possible to remove the null values or create a list of strings?
Thank you.