The keys of the hash being added are converted to a string but they keys of the corresponding hash in the selector are not converted to a string so they do not match and wrong result is given from Mongoid::Criteria::Queryable::Storable#add_field_expression
because '$in' != :$in
Currently using a symbol rather than a string will result in a different output e.g.
#Strings Band.where("foo"=>{'$in' =>["bar"]}).where('foo' => {'$in' => ['zoom']}) => {"foo"=>{'$in'=>["bar"]}, "$and"=>[{"foo"=>{'$in'=>["zoom"]}}]} #Symbols Band.where("foo"=>{:$in=>["bar"]}).where('foo' => {:$in => ['zoom']}) => {"foo"=>{:$in=>["zoom"]}} With this fix we will see the correct output #Symbols Band.where("foo"=>{:$in=>["bar"]}).where('foo' => {:$in => ['zoom']}) => {"foo"=>{:$in=>["bar"]}, "$and"=>[{"foo"=>{:$in=>["zoom"]}}]}