
Auto Delete Expired Documents in MongoDB with Node.js (TTL Index)
TTL Indexes in MongoDB are very useful for storing data like logs or user sessions. The documents will remove itself after certain amount of time which specify by the index. This tutorial will be done in both JavaScript and TypeScript using Node.js with node-mongodb-native, which is the official MongoDB Node.js driver.