0
我可以成功地創建一個範圍,以找對象,其中一個日期在一個範圍 -合併兩個日期範圍查詢Mongoid
all_matches = Person.where({
:some_date.gte => first_date,
:some_date.lte => last_date
})
但是當我使用or
代替where
它開始返回的數據不匹配任何的標準 -
all_matches = Person.or({
:some_date.gte => first_date,
:some_date.lte => last_date
}, {
:some_other_date.gte => first_date,
:some_other_date.lte => last_date
})
我看不出有任何理由,我一直在使用之前or
但不是單一的數值範圍。