mongodb / flask-pymongo

PyMongo support for Flask applications
BSD 2-Clause "Simplified" License
721 stars 175 forks source link

Flask-Pymongo not connecting to online mongodb #160

Open King-Del-ErnestO opened 2 years ago

King-Del-ErnestO commented 2 years ago

It keeps returning none when uri is passed, and when mongo.cx is passed, mongo.save_file not working.

What's wrong what's happening? Please can you help!

JEdmario16 commented 1 year ago

Try to use mongo.cx.db instead mongo.db. It worked for me.

[edit] Looking at the documentation, I realized that "mongo.db" only exists if a db is passed in the url. If you use the connection snippet that atlas provides, "mongo.db" will always be None unless a db is passed.