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.
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.Yes, we do need the list of expired events too.