import os | |
""" Initialize MongoDB connection. """ | |
# mongodb_uri = str(os.environ['MONGODB_URI']) | |
print(os.environ['MONGODB_URI']) | |
print(os.environ['DB_NAME']) | |
print(os.environ['COLLECTION_NAME']) | |
# db_name = str(os.environ['DB_NAME']) | |
# from pymongo.mongo_client import MongoClient | |
# from pymongo.server_api import ServerApi | |
# | |
# uri = "mongodb+srv://wrAIteMaster:<password>@wraitecluster.tpqpuj5.mongodb.net/?retryWrites=true&w=majority&appName=wrAIteCluster" | |
# # mongodb+srv://wrAIteMaster:<password>@wraitecluster.tpqpuj5.mongodb.net/ | |
# # 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) | |
# uri = "mongodb+srv://wrAIteMaster:<password>@wraitecluster.tpqpuj5.mongodb.net/?retryWrites=true&w=majority&appName=wrAIteCluster" | |
# mongodb_uri = "mongodb+srv://wrAIteMaster:YqGvfJDUShY5nYu8@wraitecluster.tpqpuj5.mongodb.net/?retryWrites=true&w=majority&appName=wrAIteCluster" | |
# db_name = "wrAIteDB" | |
# collection_name = "wrAIteUsers" | |
# oai_key = "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" # ADD YOUR KEY | |