-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseeds.js
54 lines (51 loc) · 3.04 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
54
var mongoose = require("mongoose");
var Campground = require("./models/campground");
var Comment = require("./models/comment");
var data = [
{
name: "Cloud's Rest",
image: "http://photosforclass.com/download/11407596925",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam posuere sapien ex, in dignissim lectus mattis sit amet. Nullam sed nibh non ipsum venenatis iaculis ac a lacus. Praesent libero eros, dignissim eu tempus vitae, rhoncus in neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin id congue nisl. Phasellus lobortis elementum diam vitae dapibus. Mauris tincidunt, libero quis pretium lobortis, dolor eros malesuada felis, ac gravida dolor eros id nibh."
},
{
name: "Hail's View",
image: "http://photosforclass.com/download/5391759757",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam posuere sapien ex, in dignissim lectus mattis sit amet. Nullam sed nibh non ipsum venenatis iaculis ac a lacus. Praesent libero eros, dignissim eu tempus vitae, rhoncus in neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin id congue nisl. Phasellus lobortis elementum diam vitae dapibus. Mauris tincidunt, libero quis pretium lobortis, dolor eros malesuada felis, ac gravida dolor eros id nibh."
},
{
name: "Snowy Basecamp",
image: "http://photosforclass.com/download/8265812638",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam posuere sapien ex, in dignissim lectus mattis sit amet. Nullam sed nibh non ipsum venenatis iaculis ac a lacus. Praesent libero eros, dignissim eu tempus vitae, rhoncus in neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin id congue nisl. Phasellus lobortis elementum diam vitae dapibus. Mauris tincidunt, libero quis pretium lobortis, dolor eros malesuada felis, ac gravida dolor eros id nibh."
}
];
function seedDB (){
//Remove all campgrounds
Campground.remove({}, function(err){
// if(err){
// console.log(err);
// } else {
// console.log("Removed campgrounds!");
// }
// data.forEach(function(seed){
// Campground.create(seed, function(err, campground){
// if(err) {
// console.log(err);
// } else {
// console.log("Added a campground");
// Comment.create({text: "This place is great.", author: "Homer"}, function(err, comment){
// if(err){
// console.log(err);
// } else {
// campground.comments.push(comment);
// campground.save();
// console.log("Created new comment");
// }
// });
// }
// });
// });
});
//add a few campgrounds
//add a few comments
}
module.exports = seedDB;