drudge / mongoose-timestamp

Adds createdAt and updatedAt date attributes that get auto-assigned to the most recent create/update timestamp
Other
308 stars 64 forks source link

Ability to expire a record #20

Closed kc-dot-io closed 10 years ago

kc-dot-io commented 10 years ago

Not sure if you care to have this, but I ran into an issue where I couldn't use this way of expiring a record on a collection that was using mongoose-timestamp so I added it as an option.

drudge commented 10 years ago

Thanks for the PR. Seeing as this doesn't actually do any expiration, I rather this be in the application or a separate plug-in.

kc-dot-io commented 10 years ago

@drudge fair enough, but to clarify, the PR doesn't achieve expiration or you don't intend the plugin to allow expiration?

drudge commented 10 years ago

It doesn't achieve expiration. It just sets a property to a configured value. That seems odd. If it did something like calculate an expiresAt property based on createdAt + options.duration it would seem more useful to me.