MongoError: cannot do raw queries on admin in atlas

How do I fix this problem in my glitch app:

MongoError: cannot do raw queries on admin in atlas

link to my app:
glitch app

In the connection string, change /admin to the name of the database which has your data, example /test

3 Likes

Worked for me.
Thank you.

Worked for me too. Thank you so much!

Hello there,
I have the same issue, but I have already /test in my connection string so what next step to go ahead ?
link to my code: https://glitch.com/edit/#!/puzzled-floss

@GoupilJeremy I had a look, your project is using an older version of node and mongoose, you may have more luck with a newer template, although it may not matter.

This is the connect string I have in .env … the quotes are needed because of the ampersand & . If your user name or password has special characters, they would need to be uuencoded.

MONGO_URI='mongodb+srv://myuser:mypassword@cluster0-myhost.mongodb.net/test?retryWrites=true&w=majority'