use*_*602 1 javascript mongodb meteor
我尝试使用最新日期获取文档,但是我收到此错误:TypeError: 'undefined' is not a function.
我的代码:
console.log(Games.find({authorId: authorId}).sort( { releaseDate: -1 } ).limit(1)); // error
console.log(Games.find({authorId: authorId}).fetch()); // expected outpout
Run Code Online (Sandbox Code Playgroud)
(该值releaseDate存在且ISODate格式正确.)任何帮助将不胜感激.
编辑:我正在使用Meteor 0.9.2.1.
得到它了!
Games.find({authorId: authorId}, { sort: { 'releaseDate' : -1 } , limit:1});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1374 次 |
| 最近记录: |