Write a Python function to connect to a MongoDB database and retrieve all documents from a collection named 'users' that have the field 'isActive' set to true. Display the results in a formatted way.
Brief introduction and purpose of your project.
List any prerequisites or dependencies that users need to install before using your project.
- Python 3.x
- MongoDB
- Other dependencies...
-
Clone the repository:
git clone https://github.com/manish-jsx/py-mongo.git
-
Navigate to the project directory:
cd py-mongo
-
Set up the virtual environment:
python -m venv venv
-
Activate the virtual environment:
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file and configure environment variables. -
Seed data into the MongoDB database:
python app.py
Explain how to use your project. Include examples, command-line options, or API documentation.
python app.py