Closed spacesuitdiver closed 8 years ago
I've search a bit around the web and I can't seem to determine the proper way to do this (MySQL adapter):
Model.find({ app: appId }) .groupBy('user') .sum('points') .limit(10) .sort({ points: 'desc' }) .populate('user') .then(results => res.ok(results))
Works with query though I'm not sure how to populate from here:
Model .query('SELECT SUM(points) as points, user FROM table GROUP BY user ORDER BY points desc LIMIT 10', (err, results) => { if (err) return res.negotiate(err) res.ok(results) } );
Whoops didn't realize I was in -docs... Moving this discussion here here.
-docs
I've search a bit around the web and I can't seem to determine the proper way to do this (MySQL adapter):
Works with query though I'm not sure how to populate from here: