feat: rename numberOfCompletedQuests to score

This commit is contained in:
wancat committed 2023-11-23 15:49:06 +08:00
1 parent 196187d5c9
commit 1a5655d7ce
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -45,15 +45,15 @@ export function leaderboard() {
},
{
$addFields: {
numberOfCompletedQuests: { $size: '$completedQuests' }, // Calculate the size of the completedQuests array
score: { $size: '$completedQuests' }, // Calculate the size of the completedQuests array
},
},
{
$match: {
numberOfCompletedQuests: { $gt: 0 }, // Filter out users who haven't completed any quests
score: { $gt: 0 }, // Filter out users who haven't completed any quests
},
},
{ $sort: { numberOfCompletedQuests: -1 } },
{ $sort: { score: -1 } },
{
$lookup: {
from: 'users',