You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did something like this.
The error: Exception in setInterval callback: TypeError: undefined is not a function
var days = 1;
Meteor.setInterval(function() {
var days_ago = new Date(new Date.getTime() - (360000 * 24 * days))
Meteor.users.find({'status.lastLogin.date': {$lte: days_ago}}).forEach(function(user) {
Meteor.users.remove({_id: user._id}, true);
});
}, (360000 * 24 * 1));
The text was updated successfully, but these errors were encountered:
chauhanshubham-dev
changed the title
How to delete/remove user if he last logged in 'x' months ago?
How to delete/remove user if he last logged in 'x' days ago?
Jun 1, 2015
I used javascript to solve this problem. Running the script after every 'y'
hours, and deleting the users as required.
But if meteor has something inbuilt, then I'll surely look into it
Thanks
I did something like this.
The error: Exception in setInterval callback: TypeError: undefined is not a function
var days = 1;
Meteor.setInterval(function() {
var days_ago = new Date(new Date.getTime() - (360000 * 24 * days))
Meteor.users.find({'status.lastLogin.date': {$lte: days_ago}}).forEach(function(user) {
Meteor.users.remove({_id: user._id}, true);
});
}, (360000 * 24 * 1));
The text was updated successfully, but these errors were encountered: