Tuesday, April 24, 2012

Ohm, find all records from array of ids

I am looking for a way to find all Ohm affiliated objects with one query, by feeding it an array of attributes that are indexed. In Mongoid, this is done with something like:



Foo.any_in(:some_id => [list_of_ids])


ActiveRecord has the find_all family of methods.



I essentially want to be able to pull N records from the data store without calling find() 30 times individually.





No comments:

Post a Comment