{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/ed9fb283149541e1d6913379ada92d44?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ed9fb283149541e1d6913379ada92d44","url":"https://api.github.com/users/solisoft","login":"solisoft","id":6237},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-03T20:54:45Z","closed_at":"2011-11-03T20:54:45Z","comments":1,"url":"https://api.github.com/repos/jnunemaker/mongomapper/issues/339","body":"Here an example : \r\n\r\nElement.where(\"$and\" => [ { :s => { \"$all\" => [\"classe\"] } }, { :s => { \"$all\" => [\"po\"] } }]).count\r\n\r\nIn the log here the result :\r\n\r\nMONGODB batitel['$cmd'].find({\"count\"=>\"elements\", \"query\"=>{:$and=>{\"$in\"=>[{:s=>{\"$all\"=>[\"classe\"]}}, {:s=>{\"$all\"=>[\"po\"]}}]}}, \"fields\"=>nil})\r\n\r\nAnd here the error : \r\n\r\nMongo::OperationFailure (Database command 'count' failed: {\"errmsg\"=>\"exception: $and expression must be a nonempty array\", \"code\"=>14816, \"ok\"=>0.0}):\r\n\r\nI 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\r\n\r\nI don't understand this \"$in\" included ...\r\n\r\nAny idea ?\r\n","html_url":"https://github.com/jnunemaker/mongomapper/issues/339","number":339,"title":"$and method don't seems to work","id":2134511,"created_at":"2011-11-03T16:43:17Z"},"action":"closed"}