-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateDb.js
More file actions
55 lines (53 loc) · 1.65 KB
/
Copy pathcreateDb.js
File metadata and controls
55 lines (53 loc) · 1.65 KB
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
conn = new Mongo();
db = conn.getDB("DotsDb");
coll = db.Users;
var currentDatetime = new Date(Date.now());
var timeCompleted = new Date(Date.now());
var userId = [new ObjectId(), new ObjectId()];
timeCompleted.setDate(currentDatetime.getDate() + 3);
coll.insertMany([
{
_id: userId[0],
Email: "let@me.in",
PasswordHash: "$2a$11$qFGEtk2DvIYJUJKSCzN1OenJEXUGIe0cdU1jyFStvQDOtkPf4QtHG", //pwd: "test"
Notices: [
{
_id: new ObjectId(),
user_id: userId[0],
Name: "Test Notice 1",
TimeCreated: currentDatetime.toISOString(),
TimeCompleted: timeCompleted.toISOString(),
IsCompleted: false
},
{
_id: new ObjectId(),
user_id: userId[0],
Name: "Test Notice 2",
TimeCreated: currentDatetime.toISOString(),
TimeCompleted: timeCompleted.toISOString(),
IsCompleted: false
}]
},
{
_id: userId[1],
Email: "test",
PasswordHash: "$2a$11$E/IyCkGNa2jT47u2yVBSke1/a7SL0o/PuwMqFmboHqih7GaqkcdH2", //pwd: "test"
Notices: [
{
_id: new ObjectId(),
user_id: userId[1],
Name: "Test Notice 3",
TimeCreated: currentDatetime.toISOString(),
TimeCompleted: timeCompleted.toISOString(),
IsCompleted: false
},
{
_id: new ObjectId(),
user_id: userId[1],
Name: "Test Notice 4",
TimeCreated: currentDatetime.toISOString(),
TimeCompleted: timeCompleted.toISOString(),
IsCompleted: false
}]
}
]);