Fix points query

This commit is contained in:
Berkeley Martinez
2016-04-06 16:54:45 -07:00
parent 40eff8d5cc
commit 7737bfedc1

View File

@ -80,7 +80,7 @@ PassportConfigurator.prototype.init = function passportInit(noSession) {
.aggregate([
{ $match: { _id: user.id } },
{ $project: { points: { $size: '$progressTimestamps' } } }
], function(err, { points = 1 } = {}) {
], function(err, [{ points = 1 } = {}]) {
if (err) { return done(err); }
user.points = points;
return done(null, user);