Node.js sails.js会话数据未保存到数据库中

Node.js sails.js会话数据未保存到数据库中,node.js,sails.js,connect-mongo,Node.js,Sails.js,Connect Mongo,我可能做错了什么。请把我引向正确的方向 我正在尝试使用“连接mongo”实现sails会话功能。我做了与文档中解释的相同的实现。成功验证后,我尝试将会话数据保存到mongoDb中。但在我的例子中,它不会保存在mongo集合中,集合始终保持为空 我在session.js中的配置 url: 'mongodb+srv://username:password@cluster0-tkjwp.mongodb.net/mydbname?retryWrites=true', collection

我可能做错了什么。请把我引向正确的方向

我正在尝试使用“连接mongo”实现sails会话功能。我做了与文档中解释的相同的实现。成功验证后,我尝试将会话数据保存到mongoDb中。但在我的例子中,它不会保存在mongo集合中,集合始终保持为空

我在
session.js中的配置

    url: 'mongodb+srv://username:password@cluster0-tkjwp.mongodb.net/mydbname?retryWrites=true',
    collection: 'sessions',
    auto_reconnect: false,
    ssl: false,
    stringify: true,
    cookie: {
        secure: false,
        maxAge: 24 * 60 * 60 * 1000
    }   
adapter: 'express-mysql-session',
host: 'localhost',
port: 3306,
user: 'root',
password: 'xxxxxxxxx',
database: 'xyz',
ssl: false,
stringify: true,
cookie: {
    maxAge: 24 * 60 * 60 * 1000
},
以及我是如何努力拯救的

if(user.length && user[0].id){
    // save in DB
    req.session.authenticated = true;
    req.session.authinfo = user[0];

    req.session.save(function(err) {
        console.log(req.session);
        return res.json({
            status: 1,
            msg: 'Successfull.'
        });                  
    })                

}else{
      return res.send({ 
        status: 0,
        msg: 'Invalid'
      });
}

此外,我没有收到任何错误

它现在正在工作。我唯一错过的是
适配器
选项。但现在我正在mysql中使用它。下面是我用MySql发布的工作代码

session.js中

    url: 'mongodb+srv://username:password@cluster0-tkjwp.mongodb.net/mydbname?retryWrites=true',
    collection: 'sessions',
    auto_reconnect: false,
    ssl: false,
    stringify: true,
    cookie: {
        secure: false,
        maxAge: 24 * 60 * 60 * 1000
    }   
adapter: 'express-mysql-session',
host: 'localhost',
port: 3306,
user: 'root',
password: 'xxxxxxxxx',
database: 'xyz',
ssl: false,
stringify: true,
cookie: {
    maxAge: 24 * 60 * 60 * 1000
},