Scripts to create, import to, inspect and test a Mongo DB.
By Erik, Richard, Bianca, Ryan and Stuart (aka Data?IBarelyKnowHer 😄)
- mongoshlongo.py: Code to convert dataset into a MongoDB dataset
- mongotest.py: Runs automated test cases
- data/validators.json: Some database strucutre rules
- data/healthcare_dataset.csv: original dataset
- CSC4013Z_Assignment1.pdf: Report
Follow the instructions to the install MongoDB shell. Then install pymongo with pip.
Use the mongoshlongo
script, for example:
python3 mongoshlongo.py convert data/healthcare_dataset.csv data.json
Converts the CSV data into structured JSON data for inserting into the db.
python3 mongoshlongo.py import healthcare_db data.json
Imports JSON data into the test_database
DB.
Imports JSON data into the healthcare_db
DB.
Use mongotest.py
to run the automated tests on a given database, like so:
python3 mongotest.py healthcare_db