forked from satyamj21/MediFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseedDoctors.js
More file actions
43 lines (33 loc) · 931 Bytes
/
Copy pathseedDoctors.js
File metadata and controls
43 lines (33 loc) · 931 Bytes
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
if(process.env.NODE_ENV !="production"){
require('dotenv').config()
}
const mongoose = require("mongoose");
const Doctor = require("./modules/doctor");
mongoose.connect(process.env.ATLAS_URL);
const doctors = [
{
name: "Dr. Sarah",
specialization: "Cardiologist",
availableDays: ["Mon", "Sat"],
availableSlots: ["10:00 AM", "10:00 PM"]
},
{
name: "Dr. Jhatka",
specialization: "Dermatologist",
availableDays: ["Tue", "Sun"],
availableSlots: ["9:00 AM", "11:00 PM"]
},
{
name: "Dr. John Smith",
specialization: "Orthopedic",
availableDays: ["Mon", "Fri"],
availableSlots: ["9:00 AM", "9:00 PM"]
},
];
async function seedDoctors() {
await Doctor.deleteMany({}); // clears old doctors
await Doctor.insertMany(doctors);
console.log("Doctors seeded successfully");
mongoose.connection.close();
}
seedDoctors();