I have two documents with arrays
a: {
"rsIds": [
"aaa",
"bbb",
"ccc",
"ddd"
]
}
and
b:{
"rsIds": [
"ccc",
"ddd",
"eee",
"fff"
]
}
I would like to have query returning all the elements of the first array, except for those which are also included in the second array, i.e.
{
"rsIds": [
"aaa",
"bbb"
]
}
What I tried to do
SELECT ARRAY_EXCEPT(e1,e2)
LET e1 = (SELECT RAW rsIds
FROM catalog USE KEYS ("a")), e2 = (SELECT RAW rsIds
FROM catalog USE KEYS ("b"));
But I still get all elements from the first array
Any advise on how could I fix the query?