diff --git a/jarvis_core/db/__init__.py b/jarvis_core/db/__init__.py index ad7ed25..5f12fb3 100644 --- a/jarvis_core/db/__init__.py +++ b/jarvis_core/db/__init__.py @@ -7,26 +7,24 @@ from jarvis_core.db.models import all_models async def connect( + host: list[str] | str, username: str, password: str, port: int = 27017, testing: bool = False, - host: str = None, - hosts: list[str] = None, - replicaset: str = None, extra_models: list = [], ) -> None: """ Connect to MongoDB. Args: - host: Hostname/IP + host: Hostname/IP, or list of hosts for replica sets username: Username password: Password port: Port testing: Whether or not to use jarvis_dev extra_models: Extra beanie models to register """ - client = AsyncIOMotorClient(host=host, username=username, password=password, port=port, tz_aware=True, tzinfo=utc) + client = AsyncIOMotorClient(host, username=username, password=password, port=port, tz_aware=True, tzinfo=utc) db = client.jarvis_dev if testing else client.jarvis await init_beanie(database=db, document_models=all_models + extra_models)