-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.js
76 lines (73 loc) · 1.49 KB
/
db.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const { MongoClient } = require("mongodb");
const mongoose = require("mongoose");
const seeder = require("mongoose-seeder");
const { Posts } = require("./models/models.js");
const { Users } = require("./models/models.js");
const url = "mongodb://127.0.0.1:27017";
const { v4: uuidv4 } = require("uuid");
const usersData = [
{
name: "Alice Johnson",
email: "[email protected]",
pwd: "P@ssw0rd123",
id: uuidv4(),
},
{
name: "Bob Smith",
email: "[email protected]",
pwd: "S3cr3tP@ss",
id: uuidv4(),
},
{
name: "Charlie Brown",
email: "[email protected]",
pwd: "MySecur3Pwd",
id: uuidv4(),
},
{
name: "David Clark",
email: "[email protected]",
pwd: "P@ssw0rd456",
id: uuidv4(),
},
{
name: "Eva Davis",
email: "[email protected]",
pwd: "Str0ngP@ssword",
id: uuidv4(),
},
{
name: "Frank White",
email: "[email protected]",
pwd: "L3tM3InN0w!",
id: uuidv4(),
},
{
name: "Grace Martinez",
email: "[email protected]",
pwd: "H3ll0@123",
id: uuidv4(),
},
{
name: "Henry Lee",
email: "[email protected]",
pwd: "P@ss!23456",
id: uuidv4(),
},
{
name: "Ivy Turner",
email: "[email protected]",
pwd: "QwertyP@ss",
id: uuidv4(),
},
{
name: "Jack Harris",
email: "[email protected]",
pwd: "J@ckP@ssw0rd",
id: uuidv4(),
},
];
const connecting = async () => {
await mongoose.connect(url, { dbName: "PR_db" });
};
module.exports = { connecting };