I have following error occurred
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MongoError: E11000 duplicate key error collection: LearningLocker_V2.statements index: id_1 dup key: { : null }
My code is
var express = require('express');
var app = express();
const xapi = require('vtc-lrs');
app.use("/xapi", new xapi());
let options = {
lrs: new xapi.LRS(),
connectionString: "mongodb://192.168.1.38:27017/LearningLocker_V2",
getUser: function (req, username, password) {
return new xapi.Account("lrsuser", "test123", true, true);
},
baseUrl: "http://localhost:8010/xapi"
};
app.use("/xapi", new xapi(options));
In the above code, I connect the mongodb remote server but it's not working. one more thing i use the xapi vts-lrs so don't know how to work with this.