hydromelvictor / ekraz

gestion de projet agile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

from pymongo import MongoClient

class CustomMongoClient: def init(self): self.client = MongoClient('mongodb://localhost:27017')

def get_client(self):
    return self.client

Créez une instance de CustomMongoClient au niveau de votre application

custom_client = CustomMongoClient()

Utilisez custom_client.get_client() pour obtenir le client MongoDB

...

À la fin de votre application, vous pouvez fermer la connexion si nécessaire

custom_client.get_client().close()

About

gestion de projet agile

License:MIT License


Languages

Language:Python 80.1%Language:CSS 12.0%Language:HTML 7.9%