Time to live in mongodb, mongoose dont work. Documents doesnt get deleted

后端 未结 2 811
北恋
北恋 2021-01-14 16:19

Im using this scheme for a session in my node.js app

var mongoose     = require(\'mongoose\');
var Schema       = mongoose.Schema;
// define the schema for o         


        
2条回答
  •  不要未来只要你来
    2021-01-14 16:35

    To double check the indexes that have been created in the DB you can run this command in your mongo shell db.yourdb.getIndexes(). When changing the indexes you have to manually delete it in the collection before the new one will take effect. Check here for more information Mongoose expires property not working properly

提交回复
热议问题