Issues on Glitch connecting with MongoDB Atlas

I am using glitch.com to learn from freeCodeCamp. The project is hosted on glitch.com for some reason its not able to connect to the mongoDB atlas.

I already have 2 collections in a cluster. Is that the maximum limit or is the problem something else. My project is at https://glitch.com/edit/#!/dawn-roan-boursin?path=server.js%3A13%3A34

:wave:

Hi @Balkrishna_Agawral and welcome to the community forums.

My guess is that something else is going on as you should be able to make more than two collections in Atlas on even the smaller tiers, unless you have more data than the storage allows.

You state you are having problems connecting to Atlas. Can you please provide information on the error you’re having? Without that anything would be speculation on our part and not helpful.

1 Like

Hi @Balkrishna_Agawral,

The Atlas Free Tier (M0) currently allows up to 100 databases and 500 collections in total, and up to 512MB of storage. For more information, please see Atlas M0 (Free Tier), M2, and M5 Limitations.

The result of your write operation should return an error code/message which will provide more context on the issue.

If your application isn’t able to connect at all, a good starting point would be confirming the credentials in your connection string as well as your Atlas whitelist entries. For troubleshooting steps, please see Connect via Driver in the Atlas documentation.

Since Glitch requests may originate from a large range of IP addresses, it is more difficult to configure an effective whitelist. See What IPs must I whitelist so my Glitch project can access my MongoDB database? on the Glitch forums for some suggestions.

Regards,
Stennie

1 Like

The issue was that I was using an older version of mongoose. upgrading to the new version worked!

1 Like

Hi @Balkrishna_Agawral,

Thanks for confirming the resolution.

If you can also comment with the Mongoose version that wasn’t working and the version that resolved your issue, this could be helpful for other users encountering the same problem in future.

Regards,
Stennie

"mongoose": "^4.7.2",

4.7.2 was not working

"mongoose": "5.7.7",

5.7.7 is working.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.