Invalid URI scheme: mongodb+srv ,Mongodb error

Viewed 5086

I am trying to connect with mongodb and my code is running fine on my system but it is giving me an error on aws server.

 import pymongo       
 url="mongodb+srv://name:Password@cluster1-actwo.mongodb.net/xyz?retryWrites=true"
 client=pymongo.MongoClient(url)
2 Answers

I fixed it!! The issue was that I had an old version of pymongo (version pymongo==3.1.1). Then I fixed it installing pymongo again with the last version pymongo==3.10.1 and dnspython.

please check if mongo and mongod versions are the same both on your system and on aws because there are different ways to handle it from mongodb 3.x.x to 4.x.x

Related