执行脚本命令:db.collectionName.ensureIndex({"fieldName": 1},{expireAfterSeconds: 864000});
如:db.httpRequestLog.ensureIndex({"requestTime": 1},{expireAfterSeconds: 864000});
mongo设置自动过期时间
原文:https://www.cnblogs.com/yucongblog/p/9110380.html