Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试根据“end_date”字段获取所有大于当前日期的文档。
我正在使用这个:
db.collection.find({end_date: {$gte: new Date()}})
但是我在附近遇到语法错误 `{end_date:'
`{end_date:'
语法似乎是正确的 - 我错过了什么吗?
谢谢!
这种语法对我来说很好用:
derick@whisky:/tmp$ mongo MongoDB shell version: 2.0.3 connecting to: test > use demo switched to db demo > db.collection.find({end_date: {$gte: new Date()}}) >