Description
We should disallow the WHEN clause on the array index, index expression section; It is misleading to allow the WHEN clause as it is ignored when indexing items. Only conditions in the where clause are honored.
the following should return an error saying "'when' clause is not allowed in index expression"
create index arr2 on default(array i.content.x1 for i in a4 when i.content.x1 = "21877d27-cf5c-448e-a94f-32c97ae6b5b8" end);
instead we should require customer to write the statement as;
create index arr3 on default(array i.content.x1 for i in a4 end)
where any j in a4 satisfies j.content.x1 = "21877d27-cf5c-448e-a94f-32c97ae6b5b8" end;
thanks
-cihan