Hi there, my documents look like this:
{
"id": "xxxx",
"firstLevel": [
{
"levelId": 12,
"secondLevel": [
{
"levelId": 34
},
{
"levelId": 56
}
]
},
{
"levelId": 78,
"secondLevel": [ ]
}
]
}
I have tons of them and I need a query like this:
SELECT r.id
FROM records r
WHERE ANY f IN r.firstLevel
SATISFIES (ANY lid IN IFMISSINGORNULL(f.secondLevel[*].levelId, [])
SATISFIES lid IN [1, 2, 3, 4] END) END
Iām trying this index:
CREATE INDEX 'hello' ON records (DISTINCT ARRAY (DISTINCT IFMISSINGORNULL(f.secondLevel[*].levelId, [])) FOR f IN firstLevel END)
But it does not speed up anything. Please help