If the field is an integer, then the following works:
But what if the field is an array? For example, the user has a field which is an array of
How to find users that have a favorite_number of 1, 3 or 5?
Edit: Added Mongoid.
Read more here: https://stackoverflow.com/questions/32979722/how-to-check-if-an-mongoid-array-field-contains-one-or-more-items-in-another-arr
This content was originally published by B Seven at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.