Not authorized on admin to execute command create socket.io. Code 8000. Codename AtlasError
-
I can successfully connect and work with a local instance of mongodb.
However, when from local dev machine I change the mongodb connection string to point to Mongodb Atlas I get the following error:not authorized on admin to execute command { create: "socket.io", capped: true, size: 5242880 } {"name":"MongoError","ok":0,"errmsg":"not authorized on admin to execute command { create: \"socket.io\", capped: true, size: 5242880 }","code":8000,"codeName":"AtlasError"}
The database is hosted on Mongodb Atlas cluster.
The user is assigned a role:
atlasAdmin
@admin
.{ "url": "http://localhost:4567", "secret": "somesecret", "database": "mongo", "mongo": { "host": "127.0.0.1", "port": 27017, "username": "", "password": "", "database": "", "uri": "mongodb+srv://<user>:<password>@somecluster.mongodb.net/somedbname" }, "port": "4567" }
MongoDb npm package version: 3.2.3
MongoDb version on Atlas: 4.0.8
Copyright © 2024 NodeBB | Contributors