-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
45 lines (31 loc) · 716 Bytes
/
init.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
const mongoose = require("mongoose");
const Chat = require("./models/chat.js");
main()
.then(()=>{
console.log("connection successful");
})
.catch(err => console.log(err));
async function main() {
await mongoose.connect('mongodb:https://127.0.0.1:27017/whatsapp');
}
allChats= [
{
from: "neha",
to: "priya",
msg:"send me your exam sheets",
created_at: new Date(),
},
{
from: "raja",
to: "priya1",
msg:"send me your exams sheets",
created_at: new Date(),
},
{
from: "neha2",
to: "priya2",
msg:"send me your examss sheets",
created_at: new Date(),
},
];
Chat.insertMany(allChats);