mongoid / origin

A Ruby DSL for building MongoDB queries
http://mongoid.org/en/origin/index.html
MIT License
62 stars 29 forks source link

.or with interval and on same field not working #93

Open arthurnn opened 10 years ago

arthurnn commented 10 years ago

https://github.com/mongoid/mongoid/issues/3110 reported this issue.

Which basically this query:

query.or({:first.gt => 1, :first.lte => 3}, {:first.gt => 20, :first.lte => 30 })

is returning this selector

[{"first"=>{"$lte"=>3}}, {"first"=>{"$lte"=>30}}]

Which is incorrect.