-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_populate.js
56 lines (52 loc) · 1.02 KB
/
db_populate.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Cory Pruce
*
* Script to populate
* the database upon
* initialization
*
* */
conn = new Mongo();
db = connect("PowernetDB");
// clear collections if already exist
db.users.remove({});
db.homehubs.remove({});
db.users.insert({
'username' : 'Cpruce',
'email' : '[email protected]',
'password': 'a13raKadabra'
});
db.users.insert({
'username' : 'test1',
'email' : '[email protected]',
'password': 'sfdsd'
});
db.users.insert({
'username' : 'test2',
'email' : '[email protected]',
'password': 'a13raKadabra'
});
db.homehubs.insert({
'hub_id' : 'fdsaf',
'location' :
{
'longitude': 37.410401,
'latitude': -122.060032
},
'devices' : {
'fan' : 'on',
'inverter': 'on',
'heater': 'on'
}
});
db.homehubs.insert({
'hub_id' : 'asdf',
'location' : {
'longitude': 37.4201052,
'latitude': -122.2021446
},
'devices' : {
'fan' : 'on',
'inverter': 'on',
'heater': 'on'
}
});