MongoError: user is not allowed to do action

前端 未结 6 503
[愿得一人]
[愿得一人] 2021-02-05 10:29

I am using MongoDB Atlas as my database.

I am using angular4 with loopback as api.

My application connects to my database fine. However, when I try to get data,

6条回答
  •  后悔当初
    2021-02-05 10:52

    If you are using v3.0 mongodb for Node.js you should use the new API as follows, and the MongoDB Atlas URI connection string for driver 3.4 and earlier:

    MongoClient.connect(uri, function(err, client) {
      console.log("Connected successfully to server");
    
      const db = client.db(dbName);
    });
    

提交回复
热议问题