How to create a array index on an array of objects

At present you can only create single key array indexes. other key will be applied post indexscan.

If your second key all the time constant you can use WHEN clause.
CREATE INDEX ix1 ON db( DISTINCT ARRAY v.a FOR v IN OBJECT_VALUES(obj) WHEN v.c = “test” END);

1 Like