Skip to content

Commit

Permalink
Mongo Script Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ruwzeta committed Sep 13, 2023
1 parent a2ae3aa commit 3bc1785
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions PyScripts/MongoDB.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pymongo.mongo_client import MongoClient
from pymongo.server_api import ServerApi
uri = "mongodb+srv://ruwindhu123:hM3PL1jFnuV7ZBl3@nba2023.hxrsjnm.mongodb.net/?retryWrites=true&w=majority"
# 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)

0 comments on commit 3bc1785

Please sign in to comment.