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
但不是单一的数值范围。