mercredi 25 février 2015

Trigger Event on auto-expiring documents - Mongo DB



I wrote a simple insert to mongo DB data base using


db.log_events.ensureIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 } ) Which will be deleted automatically after 60 minutes.


I would like to know how to invoke a script (kind of java method) whenever a MongoDB document expires automatically. I need this to remove/delete files on my system whenever there is a removal of document from mongo DB collection. Please answer me with the possible choices.




Aucun commentaire:

Enregistrer un commentaire