I tried connecting my application to my cluster on mongodb Atlas like the examples but I'm still having trouble.
I used
import pymongo
client = pymongo.MongoClient('mongodb+srv://kay:[email protected]/test')
I replaced myrealpassword with my password and cluster0 with my cluster's name .
This is the error i got :
Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/pymongo/mongo_client.py", line 468, in init res = uri_parser.parse_uri(entity, port, warn=True) File "/Library/Python/2.7/site-packages/pymongo/uri_parser.py", line 399, in parse_uri nodes = _get_dns_srv_hosts(fqdn) File "/Library/Python/2.7/site-packages/pymongo/uri_parser.py", line 289, in _get_dns_srv_hosts raise ConfigurationError(str(exc)) pymongo.errors.ConfigurationError: None of DNS query names exist: _mongodb._tcp.saudimood.mongodb.net., _mongodb._tcp.saudimood.mongodb.net.Home.
I was having similar DNS error, I misspelled the DNS seed list :s
To avoid this and another errors try:
<password>
with the password for the <username>
user. Replace myFirstDatabase
with the name of the database that connections will use by default.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With