-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.js
31 lines (26 loc) · 846 Bytes
/
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
const { MongoClient } = require("mongodb");
const { MONGO_URI } = require("./ConfigVariables");
const client = new MongoClient(MONGO_URI);
const dbName = "birthday-reminder";
const db = client.db(dbName);
const collections = {
user: "users",
eventdata: "eventdatas",
birthdays: "birthdays",
upcomingbirthdays: "upcomingbirthdays",
lists: "lists",
};
// collections
const UserCollection = db.collection(collections.user);
const EventsCollection = db.collection(collections.eventdata);
const BirthdaysCollection = db.collection(collections.birthdays);
const UpcomingBirthdayCollection = db.collection(collections.upcomingbirthdays);
const ListsCollection = db.collection(collections.lists);
module.exports = {
client,
UserCollection,
EventsCollection,
BirthdaysCollection,
UpcomingBirthdayCollection,
ListsCollection,
};