### Improve MongoDB Connection Handling: - [x] Import `MongoClient` from the `mongodb` package **ONLY ONCE** in the **ENTIRE PROJECT** - [x] Instantiate an instance of the client **ONLY ONCE** in the **ENTIRE PROJECT** - [ ] Instantiate the client at the **TOP LEVEL** of the module, **NEVER IN A FUNCTION** that returns an instance of the client - [ ] Import the client instance to other modules **ONLY** in your **DATABASE LAYER** - [ ] **NEVER** import the client instance to your **API MODULES**; **ONLY** import the **FUNCTIONS** from the database layer - [x] **NEVER** import the client into any **COMPONENTS OR PAGES**; **ONLY FUNCTIONS** from the database layer or **CREATE CALLS** to the API layer - [x] Database layer functions in components or pages **MUST ONLY EVER RUN AS SERVER-SIDE CODE**
Improve MongoDB Connection Handling:
MongoClientfrom themongodbpackage ONLY ONCE in the ENTIRE PROJECT