aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-03-01 20:40:36 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-03-01 20:40:36 -0600
commit7a486de4e902faa3bad201e83434e008cb3714b7 (patch)
tree928820952ad530bbe430a3e4176ea0be600a46a5 /build
parent0aa75f8391a3dd112b1aa6cf0278fdd0121985f5 (diff)
downloadskyblock-api-7a486de4e902faa3bad201e83434e008cb3714b7.tar.gz
skyblock-api-7a486de4e902faa3bad201e83434e008cb3714b7.tar.bz2
skyblock-api-7a486de4e902faa3bad201e83434e008cb3714b7.zip
Update database.js
Diffstat (limited to 'build')
-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 });
}