0
如何返回表中唯一值的计数?这将返回一组唯一的ID ...node-orm2获取唯一出现次数?
req.models.pages.aggregate().distinct("page").get(function (err, page) {...
// returns [ '6', '92', '90', '91', '93', '94', '102' ]
// the unique ids of the individual pages
但是,如何才能返回具有相应计数的对象?喜欢的东西...
{ '6': 2, '92':7, '90':12, etc...}
// the unique page ids with their associated counts
我看到如何聚集和我见过怎么算(),但我不明白,我可以做他们两个在一起。