Leszek Andrukanis
Leszek Andrukanis

Reputation: 2125

How can I use Mongoid finder, which accept as an argument an array of items and search for records whose values are in the array

How can I use Mongoid finder, which accept as an argument an array of items and search for records whose values ​​are in the array. Equivalent

Model.where(:id => [1,2,3,4,5]) 

with ActiveRecord. I note that a similar call in Mongoid does not bring the desired result.

Upvotes: 1

Views: 75

Answers (1)

dgasper
dgasper

Reputation: 212

Try

Model.where(:id.in => [1,2,3,4,5])

Upvotes: 1

Related Questions