This tool updates mongoDB with information from csv files by reading the csv and converting it to json to send to the database.
Install the dependencies (mongoose and csv-parser)
npm i
Create secret.js
file in the root directory, and add the connection string for the database.
Copy the csv files being used to input data into the /csv
directory. JSON output will be the same file name as the csv file, saved in the /json
directory.
npm run all
: Creates new json files from the csv inputs, then updates the database.
npm run update
: Updates the database with the current json data.
npm run json
: Creates new json files from the csv inputs only.