Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 760b346

Browse files
committed
chore: add $sort stage to calculatePresenceUsage.ts
1 parent e904bb0 commit 760b346

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/master/src/util/calculatePresenceUsage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export default function () {
1616
.collection("science")
1717
.aggregate([
1818
{ $unwind: "$presences" },
19-
{ $group: { _id: "$presences", count: { $sum: 1 } } }
19+
{ $group: { _id: "$presences", count: { $sum: 1 } } },
20+
{ $sort: { count: -1 } }
2021
])
21-
.sort({ count: -1 })
2222
.map(d => ({ [d._id]: d.count }))
2323
.toArray())
2424
);

0 commit comments

Comments
 (0)