There was a problem when express used session and mongodb links.

  node.js, question

图片描述

When accessing the browser, there will be such an error prompt:

Error setting TTL index on collection : sessions
 
 Error: Error setting TTL index on collection : sessions
 
 
 At D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ lib \ connect-mongo.js: 161: 23
 At D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ db.js: 1404: 28
 At D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ db.js: 1542: 30
 At D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ cursor.js: 159: 22
 At commandHandler (D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ cursor.js: 678: 48)
 Atdb. _ executquerycommand (d: \ web \ node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ db.js: 1802: 12)
 Nextobject (d: \ web \ node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ cursor.js: 729: 13)
 At Cursor.toArray (D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ cursor.js: 158: 10)
 At Cursor.toArray (D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ scope.js: 10: 20)
 At D:\WEB\node exercise \ login \ work \ node _ modules \ connect-mongo \ node _ modules \ mongodb \ lib \ mongodb \ db.js: 1541: 65

All warnings, no mistakes, just ignore him


Google is handy:https://cnodejs.org/topic/53e …