Swift-Query / tests /debug_uri.py
Darshan Kumar R
Deploy to Hugging Face Spaces (Clean)
ed0b977
Raw History Blame Contribute Delete
400 Bytes
import os
from dotenv import load_dotenv
load_dotenv()
uri = os.getenv("MONGO_URI")
if uri:
# Mask password
if "@" in uri:
prefix, suffix = uri.split("@", 1)
# prefix contains user:pass
print(f"URI Structure: {prefix.split('://')[0]}://<CREDENTIALS>@{suffix}")
else:
print(f"URI Structure: {uri}")
else:
print("MONGO_URI not found in environment.")