简体   繁体   English

MongoDb Atlas数据

[英]MongoDb Atlas Data

I am trying to store my node rest api data to mongodb atlas. 我正在尝试将我的节点剩余api数据存储到mongodb地图集。 But getting insertion errors. 但是出现插入错误。 I have even added the 'user' with Read and Write permissions but still no solution. 我什至添加了具有读取和写入权限的“用户”,但仍然没有解决方案。 Here is the error : 这是错误:

   {
    "error": {
        "name": "MongoError",
        "message": "user is not allowed to do action [insert] on [test.products]",
        "ok": 0,
        "errmsg": "user is not allowed to do action [insert] on [test.products]",
        "code": 8000,
        "codeName": "AtlasError"
    }
}

I resolved a similar issue by changing the connection method from mongodb+srv:// to mongodb:// . 我通过将连接方法从mongodb + srv://更改为mongodb://解决了类似的问题。

The mongodb:// connection string can be found be selecting an earlier version of the Node.js driver in the MongoDb Atlas choose a connection method section. 在MongoDb Atlas 选择连接方法部分中, 选择 Node.js驱动程序的早期版本可以找到mongodb://连接字符串。 I selected v2.2.12 or later . 我选择了v2.2.12或更高版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM