Created
November 14, 2016 14:22
-
-
Save nanoninja/0e98110606ed28a883f4ec9fdc116cc0 to your computer and use it in GitHub Desktop.
MongoDB random dataset of scores
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MongoDB fixtures | |
* | |
* Command: mongo dbname scores.js | |
*/ | |
var names = ["exam", "essay", "quiz"]; | |
for (var i = 0; i < 1000; i++) { | |
for (j = 0; j < 3; j++) { | |
db.scores.insert({"student": i, type: names[j], score: Math.round(Math.random()*100)}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment