I want to delete a document after a specified amount of time. Like if the user selects 24 hours then it should be auto-deleted after 24 hours. I heard about TTL in mongo but in that, I have to specify a time in the schema and it will be the same for all documents.
Is there any way to dynamically set the expiration time for every document?