Python Forum
MongoDB cannot connect - pymongo
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MongoDB cannot connect - pymongo
#1
Exclamation 
When I try to connect to MongoDB, I can't connect. It says the machine on the other end refused the connection.

import pymongo

baglanti = pymongo.MongoClient("mongodb+srv://newuser:[email protected]/Denemeler?retryWrites=true&w=majority")
db = baglanti["Denemeler"]

koleksiyon = db["Borc"]

koleksiyon.insert({"kullaniciadi": kullanici_adi, "sifre": sifre_giris})
What is problem? How can i solve?
   
Reply
#2
It's impossible for us to say really. Have you checked the URI you're passing on line 3? Are all the details in it correct? I suppose it's using the default Mongo port. Are you sure that that's what the server is listening on?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  websockets and pymongo exception sankar2000 0 1,043 Oct-07-2022, 09:52 PM
Last Post: sankar2000
  swapping data in mongodb saisankalpj 0 772 Aug-30-2022, 12:42 PM
Last Post: saisankalpj
  PyMongo error bagou450 0 835 Aug-04-2022, 08:27 AM
Last Post: bagou450
  pymongo wildcard query issue MikeAW2010 2 4,295 Jul-06-2021, 09:25 AM
Last Post: swag
Bug Djongo (mongoDb) - Django rest framework Problem with search on JsonFields grzybekrafal 0 2,495 May-11-2021, 09:04 AM
Last Post: grzybekrafal
  Retrieve data from MongoDB dsuk 2 2,350 Aug-24-2020, 09:22 PM
Last Post: micseydel
  find a string in a field in MongoDB Leon79 2 2,473 Jul-19-2020, 09:20 PM
Last Post: menator01
  insert more data at once in MongoDB Leon79 2 2,377 Jul-05-2020, 01:34 PM
Last Post: Leon79
  Escaping '$' in pymongo raulp2301 0 1,670 Feb-14-2020, 03:48 PM
Last Post: raulp2301
  Load JSON file data into mongodb using pymongo klllmmm 1 11,911 Jun-28-2019, 12:47 AM
Last Post: klllmmm

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020