mongodb ttl index at specific timestamp spring java code example
Example: mongodb conditional expire
let keys = { lastModifiedDate: -1 };
let options = {
expireAfterSeconds: 3600,
partialFilterExpression: { pending: true }
};
db.getCollection("collection").createIndex(keys, options);