When not is used with symbol operators, the resulting queries are incorrect:
irb(main):001:0> Band.not(:age.gt => 3) => #<Mongoid::Criteria selector: {"age"=>{"$ne"=>3}} options: {} class: Band embedded: false>
Expected behavior:
irb(main):001:0> Band.not(:age.gt => 3) => #<Mongoid::Criteria selector: {"$and"=>[{"$nor"=>[{"age"=>{"$gt"=>3}}]}]} options: {} class: Band embedded: false>
- related to
-
MONGOID-4880 Criteria for a field clobbered instead of combined when using symbol operators
- Closed
- links to