Fixed queries with arrays in where clause