ENCOA-315: Small fix and merge
This commit is contained in:
@@ -15,7 +15,10 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
const {user} = req.query;
|
||||
const snapshot = await db.collection("stats").find({ user: user }).toArray();
|
||||
const snapshot = await db.collection("stats").aggregate([
|
||||
{ $match: { user: user } },
|
||||
{ $sort: { "date": 1 } }
|
||||
]).toArray();
|
||||
|
||||
res.status(200).json(snapshot);
|
||||
}
|
||||
Reference in New Issue
Block a user