-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseeds.js
More file actions
27 lines (26 loc) · 720 Bytes
/
seeds.js
File metadata and controls
27 lines (26 loc) · 720 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
var mongoose = require('mongoose');
var Event = require('./models/event.js');
var date = new Date;
var data = [
{
title:"Demo Invite",
to: "Everyone",
body: "Hello this is a demo invite, this is how your invites will look. To accept the invite click on accept or to reject the invite click on reject",
from: "Rishabh Taparia",
time: date.toLocaleString(),
accept: false,
},
];
function seedDB()
{
// Add the demo invite
data.forEach(function(seed){
Event.create(seed,function(err,event){
if(err)
{
console.log(err);
}
});
});
}
module.exports = seedDB;