query by flat array