August 28, 2014

mongo 修改 expire TTL

不能直接用 ensureIndex 修改,要用 collMod,參考文件

範例

  • db.runCommand({collMod: 'CollectionName', index:{keyPattern: {expireKey:1}, expireAfterSeconds:expireTime(seconds)}})

No comments: