From 9ad01057a83f6f863d36344bee439c17082a6b5e Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:54:52 +0000 Subject: [PATCH] feat: Updated README.md --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5f5ef6f..362b30c 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,9 @@ python main.py ## Database Schema -1. Create new connection in MongoDB and Connect using given url - `URL: mongodb://localhost:27017/8000` - -2. Create database using +1. Configure your database connection in `API/config.py`: + - For local MongoDB, set `"local": "mongodb://localhost:27017/"` in the `DB_CONFIG` dictionary. + - For MongoDB Atlas, replace `` with your actual MongoDB Atlas connection string in the `DB_CONFIG` dictionary. Database name: `DatabaseName` Collection name: `CollectionName` @@ -90,3 +89,12 @@ pytest ## License This project is licensed under the APACHE License - see the [LICENSE](LICENSE) file for details. +## Dual Database Setup + +This project supports using both a local MongoDB instance and MongoDB Atlas for database operations. This flexibility allows for easy switching between a local database for development and a cloud-based database for production or testing purposes. + +To switch between the local MongoDB and MongoDB Atlas, instantiate the `Database` class with the `use_atlas` parameter set accordingly: +- For local MongoDB, use `Database(use_atlas=False)`. +- For MongoDB Atlas, use `Database(use_atlas=True)`. + +Note: The `recognise_face()` API endpoint is configured to exclusively use MongoDB Atlas due to its reliance on cloud-specific features.