Description
insert into default (key, value) values("k01", { "c1": "a", "arr1": [ {"id":1}, {"x":2}, {"id":1}, {"id":4} ] }); |
create index ix2 ON default(c1, ALL ARRAY v.id FOR v IN arr1 END); |
SELECT * FROM default WHERE c1 = "a" AND ANY v IN arr1 SATISFIES v.id IS MISSING END; |
|
"spans": [ |
{
|
"exact": true, |
"range": [ |
{
|
"high": "\"a\"", |
"inclusion": 3, |
"low": "\"a\"" |
},
|
{
|
"high": "null", |
"inclusion": 0 |
}
|
]
|
}
|
]
|
Above query generates MISSING span. This works correctly on scalar but not on array index key. Array Index key doesn't store MISSING values each array.
This gives 0 results but primary index gives 1 result.
Array Index key indexes MISSNG.
- when whole array is empty
- when individual element is MISSING it ignores unless all elements are MISSING then result in empty array
Don't know what is right behavior. Either fix the array indexing or do missing span?