mongoose - change ttl for a single document

前端 未结 2 1674
抹茶落季
抹茶落季 2020-12-17 05:22

I have a very certain thing i want to accomplish, and I wanted to make sure it is not possible in mongoose/mongoDB before I go and code the whole thing myself. I checked mon

2条回答
  •  长情又很酷
    2020-12-17 05:38

    You could use the expire at clock time feature in mongodb. You will have to update the expire time each time you want to extend the expiration of a document.

    http://docs.mongodb.org/manual/tutorial/expire-data/#expire-documents-at-a-certain-clock-time

提交回复
热议问题