Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

How to delete by date? #200

Closed scheung38 closed 7 years ago

scheung38 commented 8 years ago

is the collection-hooks deleted because it reached maximum number of records, or deleted after, say 1 year? I want to delete, say 1 year(or some other expiration date).

If I understood correctly it is using

after.insert() 

hook to remove the oldest items once you have reached your cap, but does that also applies when it is older than, say 1 year? If so could you provide an example? Cheers.

namirsab commented 8 years ago

mmm @scheung38 if i understand well, you want to use a hook to delete certain documents after every insert? Or you want to run a periodic script that cleans your database removing some documents that apply to a predicate?

zimme commented 7 years ago

Closing this because of inactivity, @scheung38 please provide more info about your question if you need it answered.