我是Mongo的新手。Mongodb - 如何查询日期范围?
我想查询日期范围。用户模型具有这一领域:
field :confirmed_at, :type => Time
可能有人帮我写一个查询来获取用户谁确认其账户在一段时间范围?
以下是错误和查询我想:
> db.users.where(:confirmed_at.gte => Time.now, :confirmed_at.lte => 10.minutes.ago)
Tue May 29 17:45:37 SyntaxError: syntax error (shell):1
Model.where(:confirmed_at.gte => Time.now, :confirmed_at.lte => 10.minutes.ago)
Tue May 29 17:56:15 SyntaxError: syntax error (shell):1
谢谢!
试试第一 –
那你试试? –
为什么你问同样的问题两次? –