database.py 200 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 import pymongo def get_connection(collection:str): client = pymongo.MongoClient('mongodb://easybistro:xejP3257@localhost:27017/Easybistro') return client['easybistro'][collection]