會話被設置爲一個哈希: 1) "sid:lpg3um654ckqp7tj7fkr2qs2Zz" (this has a ttl of a week)
2) "sid:lpg3um654ckqp7tj7fkr2qs2Yy" (this has a ttl of 6 days)
3) "sid:g6sftph5dnun5bk6l0hqyyh6p5" (this has a ttl of 5 day
我有要求在我的應用中設置一個文檔集合的TTL,但也需要這些文檔被其他集合引用,我不確定這將如何工作? 設置文檔上的TTL是否在所有其他參考文檔過期時刪除該文檔,或者我必須自己編寫後端進程而不使用mongoDb的TTL索引? 的功能的示例模式我會想: var mongoose = require('mongoose')
, Schema = mongoose.Schema
var pe