import os
from pymongo import MongoClient
from dotenv import load_dotenv


def database_entry(data):
    try:
        load_dotenv()
        mongo_string = os.getenv('MONGODB_AUTH_URI')
        client = MongoClient(mongo_string)
        database = client[os.getenv('MONGODB_DB')]
        col = database['users']
        col.insert_one(data)
        return True
    except Exception as e:
        print(e)
        return False


if __name__ == "__main__":
    pass

[((8, 8, 8, 21), 'dotenv.load_dotenv', 'load_dotenv', ({}, {}), '()', False, 'from dotenv import load_dotenv\n'), ((9, 23, 9, 52), 'os.getenv', 'os.getenv', ({(9, 33, 9, 51): '"""MONGODB_AUTH_URI"""'}, {}), "('MONGODB_AUTH_URI')", False, 'import os\n'), ((10, 17, 10, 42), 'pymongo.MongoClient', 'MongoClient', ({(10, 29, 10, 41): 'mongo_string'}, {}), '(mongo_string)', False, 'from pymongo import MongoClient\n'), ((11, 26, 11, 49), 'os.getenv', 'os.getenv', ({(11, 36, 11, 48): '"""MONGODB_DB"""'}, {}), "('MONGODB_DB')", False, 'import os\n')]