-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseed.js
103 lines (93 loc) · 2.05 KB
/
seed.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
var db = require("./models");
//use JoinIn
//db.dropDatabase();
var SanFrancisco = {
location: {
lat: 1,
lng: 1
},
name: "San Francisco",
logo: "/images/logo.svg", //url to image
blurbs: [{
poster: "Brandon",
textContent: "This app is bae.",
likes: 100,
imgPath: ""
}, {
poster: "Lynette",
textContent: "I'm gonna bake you a cookie",
likes: 101,
imgPath: ""
}, {
poster: "Ilias",
textContent: "Theo, drop it!",
likes: 1,
imgPath: ""
}]
}
var NewYorkCity = {
location: {
lat: 1,
lng: 1
},
name: "New York City",
logo: "/images/logo.svg", //url to image
blurbs: [{
poster: "Claire",
textContent: "Bananas overtake world",
likes: 10,
imgPath: ""
}, {
poster: "Nathan",
textContent: "Is that a !@$% trailing whitespace?!",
likes: 1,
imgPath: ""
}, {
poster: "Theo",
textContent: "Bark.",
likes: 10000,
imgPath: ""
}]
}
var Seattle = {
location: {
lat: 1,
lng: 1
},
name: "Seattle",
logo: "/images/logo.svg", //url to image
blurbs: [{
poster: "Neda",
textContent: "Where's Theo?",
likes: 9,
imgPath: ""
}, {
poster: "Teddy",
textContent: "I could really use a Noah's Bagel right about now",
likes: 55,
imgPath: ""
}, {
poster: "Lily",
textContent: "I'm blue bob a deeb ah buh bye.",
likes: 10,
imgPath: ""
}]
}
db.City.create(SanFrancisco, function(err, city) {
if (err) {
return console.log("Error!", err);
}
console.log("new city", city)
});
db.City.create(NewYorkCity, function(err, city) {
if (err) {
return console.log("Error!", err);
}
console.log("new city", city)
});
db.City.create(Seattle, function(err, city) {
if (err) {
return console.log("Error!", err);
}
console.log("new city", city)
});