-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseeds.js
53 lines (51 loc) · 1.62 KB
/
seeds.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
var mongoose = require("mongoose");
var Rave = require("./models/rave");
var Comment = require("./models/comment")
var data = [
{
name: "Dream Bubble 5.0",
image: "https://s-media-cache-ak0.pinimg.com/736x/68/14/29/681429412e916ab6a8b217adb20684ed.jpg",
description: "blah blah blah"
},
{
name: "Spirit Gust 4.0",
image: "https://s-media-cache-ak0.pinimg.com/564x/6f/12/36/6f12369f600e264ba63aac5631d5d2c1.jpg",
description: "blah blah blah"
},
{
name: "Kundalini 5.0",
image: "https://s-media-cache-ak0.pinimg.com/originals/0c/5b/7e/0c5b7e02a01b15afa76c3cfba6221865.jpg",
description: "blah blah blah"
}
]
function seedDB(){
Rave.remove({}, function(err){
// if(err){
// console.log(err);
// }
// console.log("removed raves");
// data.forEach(function(seed){
// Rave.create(seed, function(err, rave){
// if(err){
// console.log(err)
// } else {
// console.log("added a rave");
// Comment.create(
// {
// text: "This is great Hi-tech Event, get ready to lose yourselves in the depth of sounds",
// author: "Vikram"
// }, function(err, comment){
// if(err){
// console.log(err)
// }else{
// rave.comments.push(comment);
// rave.save();
// console.log("Created new comment")
// }
// });
// }
// });
// });
});
}
module.exports = seedDB;