如何执行此查询?
SELECT * FROM blog
GROUP BY MONTH(createdAt)
我试过的:
Blog.find()
.groupBy({MONTH:'createdAt'})
.exec(function(err,months){
res.view({
layout: 'blogLayout',
archive:months
});
});
给我错误:没有计算就不能分组