Switch data storage over to MongoDB.
Review Request #7235 — Created April 21, 2015 and submitted
As sonar gets more complicated, it's no longer feasible to manually maintain a
big JSON file to store all the data. This change swaps that out in favor of
MongoDB, hosted via a heroku add-on.The schema itself is currently identical to what I was using in students.json,
so there's very little to change on the front-end. The only difference is that
there's less depth to get to the actual students, since I removed the whole
top-level "term" nonsense.The nice thing about this is that it will now be very easy to add lots of
functionality that requires the web server to be able to write data (such as
having students submit their status reports directly).
Verified that everything still loaded correctly.
Description | From | Last Updated |
---|---|---|
Why mongodbURL instead of mongodbURI ? |
brennie | |
This doesn't seem to actually use app. |
brennie | |
This is the exact same code as in bin/load-slack-users. Can we refactor this out into somewhere both modules can use … |
brennie | |
Is there ever a case where we will be initializing mongoDB but not the schema (assuming the connection is successful) … |
brennie |
-
Tool: PEP8 Style Checker Ignored Files: lib/config.js package.json server.js bin/load-slack-users lib/students.js lib/frontend/main.js lib/schema.js lib/routes.js Tool: Pyflakes Ignored Files: lib/config.js package.json server.js bin/load-slack-users lib/students.js lib/frontend/main.js lib/schema.js lib/routes.js
-
A few refactory nits, but it looks good to me!
-
-
This is the exact same code as in
bin/load-slack-users
. Can we refactor this out into somewhere both modules can use it? -
Is there ever a case where we will be initializing mongoDB but not the schema (assuming the connection is successful) ?
If not, why don't we include this in the promise resolving function in
initMongodb
?
- Description:
-
As sonar gets more complicated, it's no longer feasible to manually maintain a
big JSON file to store all the data. This change swaps that out in favor of MongoDB, hosted via a heroku add-on. The schema itself is currently identical to what I was using in students.json,
so there's very little to change on the front-end. The only difference is that there's less depth to get to the actual students, since I removed the whole top-level "term" nonsense. The nice thing about this is that it will now be very easy to add lots of
functionality that requires the web server to be able to write data (such as having students submit their status reports directly). - - Testing done:
- Verified that everything still loaded correctly.