python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Auto delete a document after specific time in mongoDB
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...
Het Delwadiya
Votes: 0
Answers: 2
how to delete a record of a collection after a specific amount of time
i want to create an OTP (one time password) for my node js application using mongodb as database
after generating otp and sending that for client with email i want to store the otp as hashedOTP in dat...
mehraeen mozhdi
Votes: 0
Answers: 1
MongoDB TTL index never deletes records
I created an index as shown below and added a createdAt field to each new record added to the db. The records should be auto-deleted after 24 hours however I have waited days and nothing has been dele...
Amber Johnson
Votes: 0
Answers: 1
MongoDB TTL does not works
I work on debian 10(buster) with mongod ver. 4.2.17. I want to use TTL to remove older documents on collection. I do walk around and I'm sure that no typo on the query.
I followed dummy example offica...

Dhody Rahmad Hidayat
Votes: 0
Answers: 1