transpolymer commited on
Commit
67a1a5e
·
verified ·
1 Parent(s): 8dad517

Upload db.py

Browse files
Files changed (1) hide show
  1. db.py +9 -0
db.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from pymongo import MongoClient
2
+
3
+ # MongoDB URI with actual credentials
4
+ CONNECTION_STRING = "mongodb+srv://transpolymer:transpolymer365@cluster0.2ojpls3.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
5
+
6
+ # Function to get the database
7
+ def get_database():
8
+ client = MongoClient(CONNECTION_STRING)
9
+ return client["transpolymerDB"] # Your database name