简体   繁体   中英

MongoDB not connecting

I currently have a node.js app that uses MongoDB as it's database. When I try to connect it to the database, I keep getting the error:

MongoError: not authorized for query on <database_name>.<collection_name>

This was working a few months ago, but now it doesn't work. Please tell me what's wrong.

I am using MongoLab.

I recommend checking to see if MongoLab is still hosting your stuff. If you haven't used it in a while, they may have terminated your service. Log in and give it a quick check before you go any further.

What's your connection string look like? Can you verify that your username, password, and mongo lab url are all correct (they're pretty long!).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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