I am trying to query MongoMapper with “or” statement. I’ve found an example of how to do it with mongo directly:
db.foo.find( { $or : [ { a : 1 } , { b : 2 } ] } )
so I thought the MongoMapper query should be looks like this:
Foo.all(:or => [ {:a => 1}, {:b => 2} ])
but it doesn’t.
Can anyone help?
You’d want this:
or this for MongoMapper:
MongoMapper queries are pretty much a straight transliteration of the queries you’d use in the MongoDB shell.