- Python 3.10+
- Docker
Mongo Express is added to access use localhost:8081
username: admin
password: pass
STEP 1 Clone the Project using this command
git clone <URL>
STEP 2
Run the docker compose file in detach mode
docker compose up -d
STEP 3
Check in the terminal using this command
docker ps
the mongodb would exposed in the port 27017
To connect the mongo use this uri
mongodb://<USERNAME>:<PASSWORD>@localhost:27017/?retryWrites=true&w=majority
change the USERNAME and PASSWORD with correct credentials
For the reference check this StackOverFlow
Run the below commands to load the sample data
python -m venv env
source env\bin\activate
pip install -r requirements.txt
python load_data.py
docker exec -it mongo mongosh -u <username> -p <password> --authenticationDatabase admin
use <DATABASE_NAME>
- Create a folder prefix with
sample_, for examplesample_mydata, the folder name consider as aDatabase Name - Create a
.jsonfile inside the folder. you can creatennumber of files. each file is consider as a collection thefilenameconsider as acollection name. - you can run the python script using this command
-
python load_data.py