0
votes

so I just deployed a MongoDB cluster in Atlas. I configured the users, and restored a backup from a previous database.

Now, when I try to connect to the database from node, with this URI: 'mongodb+srv://<-USER>:<-PWD>@<-HOST>/<-DB>?retryWrites=true' i run into some problems.

The connection is successfull, but whenever I send a request and the node server tries to query the database the connection yields the following error: {"name":"MongoError","message":"user is not allowed to do action [find] on [admin.]","ok":0,"errmsg":"user is not allowed to do action [find] on [admin.]","code":8000,"codeName":"AtlasError"}

It seems the connection is querying the admin database, even though i do especify a different database in the <-DB> parameter of the URI.

Any ideas?

Thanks in advance!

1

1 Answers

0
votes

It's working now, I'll post the answer in case someone runs into the same issue.

It seems it was just a problem with mongoose; I was working with the 5.0.10 version, I updated to 5.1.7 and it works perfectly.