Answers for "mongodb conditional expire"

0

mongodb conditional expire

let keys = { lastModifiedDate: -1 };
let options = { 
    expireAfterSeconds: 3600, 
    partialFilterExpression: { pending: true }
};
db.getCollection("collection").createIndex(keys, options);
Posted by: Guest on April-29-2020

Browse Popular Code Answers by Language