Node.js mongodb set default safe variable

前端 未结 3 1875
暗喜
暗喜 2021-02-19 14:48

I am trying to run a Node.js script locally and it\'s giving me this error message:

===============================================================         


        
3条回答
  •  半阙折子戏
    2021-02-19 14:56

    I got it to work by setting the strict mode to false.

    var db = new Db(config.dbName, new Server("127.0.0.1", 27017, {}), {safe: false, strict: false}); 
    

提交回复
热议问题