When querying using or(), '$or', or even other nested queries like '$and', mongoid is improperly clobbering multiple criteria for the same field.
For example, `where(:left.gte => 8, :left.lte => 12)` results in the criteria `{"left"=>{"$gte"=>8, "$lte"=>12}}`.
In contast, using the same as part of or(), `or({:left.gte => 8, :left.lte => 12})` results in the criteria `{"$or"=>[{"left"=>{"$lte"=>12}}]}` which is missing the `:left >= 8` condition entirely.
Directly specifying '$or' inside of where() exhibits the same problem, as does even using '$and', suggesting that it's farther reaching than merely 'or'.
An example to reproduce the issue is attached.
- is related to
-
MONGOID-4884 not creates incorrect queries when symbol operators are given
- Closed
-
MONGOID-4883 Document symbol operator querying
- Closed
- links to