Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python #5199

Closed
Techasit232000 opened this issue Jan 28, 2025 · 1 comment
Closed

Python #5199

Techasit232000 opened this issue Jan 28, 2025 · 1 comment

Comments

@Techasit232000
Copy link

from pymongo.mongo_client import MongoClient
from pymongo.server_api import ServerApi

uri = "mongodb+srv://techasit14607:<db_password>@cluster1.yw0wz.mongodb.net/?retryWrites=true&w=majority&appName=Cluster1"

Create a new client and connect to the server

client = MongoClient(uri, server_api=ServerApi('1'))

Send a ping to confirm a successful connection

try:
client.admin.command('ping')
print("Pinged your deployment. You successfully connected to MongoDB!")
except Exception as e:
print(e)

@aarnphm
Copy link
Contributor

aarnphm commented Jan 31, 2025

Hi, please open a separate issue stating your bug/problem. Thanks.

@aarnphm aarnphm closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants