Seeds the Database for UCSD Rooms
Make sure to have a local instance of MongoDB running, then:
- Make sure to set the
QUARTER
variable inget_codes.js
to the desired quarter (eg.const QUARTER = 'SP17'
) - Run
node get_codes.js
- Make sure to set the
QUARTER
variable insocs.js
to the desired quarter (eg.const QUARTER = 'SP17'
) - Create a
data
directory - Edit the for loop in
socs.js
to run only 10 times eg.for (let i = 0; i < 10; i++) {}
if not the operation times out and there will be data loss. - Run
node socs.js
- Repeat steps 5 and 6 but update the values by 10 each time until one file for each department has been written to the data folder
- Run
node add_rooms.js
- Run
node add_times.js
- Run
node add_openings.js