Mongoid query for array field
Or another variant:
Model.in(category: ['val1','val2'])
You can use Criteria all_in
to make it simpler:
Model.all_in(category: ['val1','val2'])
In mongoid, there is '$in' operator. So you can do this :
Model.where(category: { '$in': ['val1', 'val2'] })
This worked
Model.where(:category.in => ['val1','val2'])
From Mongo Docs