moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 513 forks source link

Error: invalid schema, expected mongodb #791

Open kyooryoo opened 5 years ago

kyooryoo commented 5 years ago

I have a sample code with the titled error when I run: mosca -c index.js -v The code of index.js is:

let SSL_KEY = __dirname + '/certs/key.pem';
let SSL_CERT = __dirname + '/certs/certificate.pem';
let MONGOURL = 'mongodb+srv://admin:<passsword>@mypj-oq6wk.mongodb.net/test';
module.exports = {
    id: 'broker',
    stats: false,
    port: 8443,
    logger: {
        name: 'mypj',
        level: 'debug'
    },
    secure: {
        keyPath: SSL_KEY,
        certPath: SSL_CERT,
    },
    backend: {
        type: 'mongodb',
        url: MONGOURL
    },
    persistence: {
        factory: 'mongo',
        url: MONGOURL
    }
};

How could I fix this schema issue?