added support for $and, $or in array query