Index creation information

Hi team,
we are running query on below document. what is the index we have to create for this? we are using status and $type field for the querying.
advise suggests below: CREATE INDEX aabIx ON poc(ALL ARRAY RunStat.Status FOR RunStat IN RunStats END,$Type) WITH { “defer_build”:true, “nodes”:[ “bbbb:8091”,“aaaa:8091” ], “num_replica”:1 }

document:
{
“Id”: “abc::14835”,
“$Type”: “abc”,
“$MdfdById”: “yyy”,
“$MdfdTmstmp”: “2020-06-23T15:18:13.263Z”,
“RunStats”: [ { “Transaction”: “bvc”,
“Status”: “Inprogress”,
“BatchId": “yyyyyyy”,
“CreateTime”: “2020-06-23T15:18:13.263Z”,
“ValidForMins”: “9999”,
“RecCount”: “98”
} ]
}

Post your query. Seems right

CREATE INDEX  `aabIx`  ON  `poc` (ALL ARRAY  `RunStat`.`Status`  FOR RunStat IN  `RunStats`  END, `$Type` ) 
WITH { "defer_build":true, “nodes”:[ “bbbb:8091”,“aaaa:8091” ], “num_replica”:1 }

select d.* from poc as d UNNEST RunStats AS RunStat
WHERE RunStat.Status = ‘Inprogress’ and $Type=‘abc’

Above index is right. If $Type is constant for the queries

CREATE INDEX  `aabIx`  ON  `poc` (ALL ARRAY  `RunStat`.`Status`  FOR RunStat IN  `RunStats`  END) 
WHERE `$Type` = "abc";