// To remove expired alerts from the alerta database run this script from cron like so: 
// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js
now = new Date();
db.alerts.remove({'status': 'CLOSED'});
db.alerts.remove({'expireTime': { $lt: now }});

// To remove expired alerts from the alerta database run this script from cron like so: 
// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js
now = new Date();
db.alerts.remove({ 'status': 'CLOSED', 'expireTime': { $lt: now }});

Rollback remove expired OR closed alerts
Rollback remove expired OR closed alerts
