aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/database.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/build/database.js b/build/database.js
index 45bde6e..08bbb22 100644
--- a/build/database.js
+++ b/build/database.js
@@ -263,9 +263,11 @@ async function removeBadMemberLeaderboardAttributes() {
unsetValue[leaderboard] = '';
const filter = {};
const requirement = await getMemberLeaderboardRequirement(leaderboard);
+ const leaderboardReversed = isLeaderboardReversed(leaderboard);
if (requirement !== null) {
filter[`stats.${leaderboard}`] = {
- '$lt': requirement
+ '$lt': leaderboardReversed ? undefined : requirement,
+ '$gt': leaderboardReversed ? requirement : undefined
};
await memberLeaderboardsCollection.updateMany(filter, { '$unset': unsetValue });
}