Mongoose expires property not working properly

前端 未结 1 1977
悲&欢浪女
悲&欢浪女 2021-01-06 12:08

the answer

So it turns out when I was testing using the expires property in Mongoose, I successfully set a TTL index in the database, but d

相关标签:
1条回答
  • 2021-01-06 12:39

    Modifying your Mongoose schema won't modify an existing index, so you need to manually drop the TTL index and restart your app to re-create the index using the current definition.

    db.sampletexts.dropIndex('createdAt_1')
    
    0 讨论(0)
提交回复
热议问题