2016-11-21 50 views

回答

0

在旧版本的蒙戈,你曾经有那种使用的能力+独特的那样:

db.collection.distinct("date").sort({date:1}) 

但是现在没有这样的可能性,的“独特”命令文件,但造成的结果“排序”功能只能呼吁光标https://docs.mongodb.com/v3.2/reference/method/cursor.sort/

+0

不喜欢光标见面hod,我可以像*> db.collection.distinct(“date”,{'$ sort':{'date':1}})* –

相关问题