Existing behavior:
irb(main):007:0> Band.where(year: 2020, :year.gt => 1960) => #<Mongoid::Criteria selector: {"year"=>2020, "$and"=>[{"year"=>{"$gt"=>1960}}]} options: {} class: Band embedded: false>
Desired behavior:
irb(main):010:0> Band.where(year: 2020, :year.gt => 1960) => #<Mongoid::Criteria selector: {"year"=>{"$eq"=>2020, "$gt"=>1960}} options: {} class: Band embedded: false>
This was already done for `and` in https://jira.mongodb.org/browse/MONGOID-5020, the present ticket covers making the same change for `where` and, as side effects, or/nor/not.
Also this ticket would fix the following misconstruction in 7.2:
irb(main):006:0> Band.or(year: 2020, :year.gt => 1960) => #<Mongoid::Criteria selector: {"$or"=>[{"year"=>{"$gt"=>1960}}]} options: {} class: Band embedded: false>
- related to
-
MONGOID-5020 Condition lifting breaks with symbol operators on Ruby <= 2.6
- Closed
- links to