DEV Community

[Comment from a deleted post]
Collapse
 
jz222 profile image
Timo Zimmermann

Is it really necessary to move the documents into another collection? Usually, you would just add the expiration time to your events when you create them and index that key. You can then query the collection with the $gte or $lte operator to receive all the active or expired events.

Collapse
 
mayankjoshi profile image
mayank joshi

Yes, we do need the list of expired events too.