-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdebug-provision.js
37 lines (32 loc) · 1.12 KB
/
debug-provision.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function createRootUser() {
db.users.insert({
'id': 'rootUser',
'local' : {
'password' : '$2a$08$CjOoGRoCxrIzYL4VVQdnlubLNCPwlY.RrZ78L9RjgZvTTHYsWXHwe',
'name' : 'Sven Hecht',
'email' : '[email protected]'
},
'admin': true
});
}
var query = { 'local.email':'[email protected]' };
var result = db.users.find(query);
if (result.length() > 0) {
db.users.remove(query);
createRootUser();
} else {
for (var i=0; i<20; i++) {
createRootUser();
db.courses.insert({
name : 'Course ' + i,
description : 'Monofilament math-girl apophenia nodal point geodesic Kowloon soul-delay. Faded tube nodal point paranoid into boat numinous BASE jump 3D-printed neural tank-traps bomb. Corporation tattoo dome towards motion dolphin bridge carbon drone.',
state : 'published',
date : '01.01.2015',
doodle : 'http://doodle.com/',
participants : [ ],
teachers : [ 'rootUser' ],
infolink : 'http://google.de/',
imglink : 'http://lorempixel.com/400/400/?v=' + i
});
}
}