I am using mongoid for rails (latest version).
I have a collection full of documents, each with a property that is a hash.
I want to do a query that will determine how many elements of a given array are hash keys in the array in a single document.
Something like:
@count = Product.where('id':'343434343').vendors_in_array('Walmart','Kmart').count()
Is this possible or do I need to pull back the entire document and figure it out in RoR?
I will handle this in some other way because it doesn’t seem to be the best approach.