2016-11-21 40 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}})* –

相關問題