I have JSON object:
{
"type": "...",
"start": 0,
"end": 93,
"items": [
{
"type": "...",
"start": 0,
"end": 93,
"more": {
"type": "...",
"start": 0,
"__FOO__": true,
"end": 93,
I want to get __FOO__
property from that object using json-query.
The problem is __FOO__
can be anywhere in the object. I mean deep inside or at the root. also the object structure can be change (array may be object or even not exist).
So I tried to get this property using this syntax but it doesn't work. What is the syntax that can find me __FOO__
?
const data = require("./data.json");
const jsonQuery = require("json-query");
const x = jsonQuery("[__FOO__]", { data });
console.log(x);