MongoDB & mongoose | How to automatically remove element from array after certain amount of time?
I'm creating Instagram clone and right now working with stories. I need them to be visible to followers for only 24h, so I was thinking of giving each user
activeStories
activeStories
field which would be array of story IDs that user posted within last 24h. But I'm not sure how I would remove them after 24h. Is there a built-in way to handle this or am I gonna have to handle that myself?