MongoDB's TTL (Time To Live) fully implemented with NodeJS and Express.
MongoDB is one of the widely used NoSQL database. Sometimes we need to automatically remove documents from a collection after a certain amount of time or at a specific clock time. So here I show how to implement easily TTL indexes and configure it on demand with calling just a single API.
Create a .env file based on .env-example file.
Ensure you have node 10 or higher.
npm install
PORT=<your_expected_port> npm run dev
http://localhost:<your_expected_port>