Skip to content

Commit

Permalink
Update delete_old_members.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LaNinja06 authored Dec 4, 2024
1 parent 3d66ff5 commit fccb3a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/scripts/member-managament/delete_old_members.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ var days = 30;
//query states not logged in in last N days , but logged in at least once

var ts = Math.round(Date.now() / 1000) - days * 24 * 60 * 60;
var query = {"$and": [{"last_login": {"$lt": ts}}, {"last_login": {"$exists": true}}, {"global_admin": {"$ne": true}}]};
// {"global_admin": {"$ne": true}} ensures that global admins are excluded from deletion. If set to {"$ne": false}, global admins will not be excluded and will be deleted as well.
var query = {"$and": [{"last_login": {"$lt": ts}}, {"last_login": {"$exists": true}}, {"global_admin": {"$ne": true}}]};
// {"global_admin": {"$ne": true}} ensures that global admins are excluded from deletion. If set to {"$ne": false}, only global admins which matches other rules will be deteled.

//although mogodb does not return null on $lt, keep like above for safety

Expand Down

0 comments on commit fccb3a0

Please sign in to comment.