Repository navigation
Expand file tree
/
Copy pathinit.js
More file actions
84 lines (71 loc) · 1.34 KB
/
Copy pathinit.js
File metadata and controls
84 lines (71 loc) · 1.34 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const mongoose = require('mongoose');
const Chat = require("./models/chat");
main()
.then(() =>{
console.log("conncetions successful");
})
.catch(err => console.log(err));
async function main() {
await mongoose.connect('mongodb://127.0.0.1:27017/chitchat');
}
let allChats = [{
from:"harvy",
to: "bob",
msg: "Are you coming to the meeting?",
created_at: new Date()
},
{
from: "charlie",
to: "dave",
msg: "Please review the document.",
created_at: new Date()
},
{
from: "eve",
to: "frank",
msg: "Happy birthday!",
created_at: new Date()
},
{
from: "grace",
to: "heidi",
msg: "Let's catch up later.",
created_at: new Date()
},
{
from: "ivan",
to: "judy",
msg: "Can you send me the report?",
created_at: new Date()
},
{
from: "karen",
to: "leo",
msg: "Meeting has been rescheduled.",
created_at: new Date()
},
{
from: "mallory",
to: "nancy",
msg: "Where are the keys?",
created_at: new Date()
},
{
from: "oscar",
to: "peggy",
msg: "Let's start the project tomorrow.",
created_at: new Date()
},
{
from: "quinn",
to: "ruth",
msg: "Lunch at 1 PM?",
created_at: new Date()
},
{
from: "sybil",
to: "trent",
msg: "Please join the conference call.",
created_at: new Date()
}];
Chat.insertMany(allChats);