aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/database.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/database.ts b/src/database.ts
index a4e401a..0ed8c7c 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -293,9 +293,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,