jnunemaker/mongomapper — Issue #339: $and method don't seems to work
Author: solisoft
Created: 2011-11-03 16:43:17+00:00
State: open

Here an example :

Element.where("$and" => [ { :s => { "$all" => ["classe"] } }, { :s => { "$all" => ["po"] } }]).count

In the log here the result :

MONGODB batitel['$cmd'].find({"count"=>"elements", "query"=>{:$and=>{"$in"=>[{:s=>{"$all"=>["classe"]}}, {:s=>{"$all"=>["po"]}}]}}, "fields"=>nil})

And here the error :

Mongo::OperationFailure (Database command 'count' failed: {"errmsg"=>"exception: $and expression must be a nonempty array", "code"=>14816, "ok"=>0.0}):

I use Plucky 0.3.8 (I saw there is a 0.4.2) but mongo_mapper 0.9.2 depends on Plucky 0.3.8

Any idea ?