from pymongo import MongoClient

client = MongoClient("mongodb://jenya:DJenya$Mongo%40St0ckDB@172.105.59.175:27017/")
db = client["trade_iq"]
coll = db["zerodha_credentials"]

# Fetch the last inserted document
get_creds = coll.find().sort([("_id", -1)]).limit(1)

# Print the result
print(get_creds[0]["enctoken"])
print(get_creds[0]["websocket"])