-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbseed.js
More file actions
40 lines (38 loc) · 1.48 KB
/
Copy pathdbseed.js
File metadata and controls
40 lines (38 loc) · 1.48 KB
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
module.exports.seed = (mongo) => {
mongo.collection('$bindings$', { strict: true }, function(err, collection) {
if (err) {
//console.log("The 'bindings' collection doesn't exist. Creating it with sample data...");
}
});
}
// db.collection('wines', {strict:true}, function(err, collection) {
// if (err) {
// console.log("The 'wines' collection doesn't exist. Creating it with sample data...");
// populateDB();
// }
// });
/*--------------------------------------------------------------------------------------------------------------------*/
// Populate database with sample data -- Only used once: the first time the application is started.
// You'd typically not find this code in a real-life app, since the database would already exist.
// var wines = [
// {
// name: "CHATEAU DE SAINT COSME",
// year: "2009",
// grapes: "Grenache / Syrah",
// country: "France",
// region: "Southern Rhone",
// description: "The aromas of fruit and spice...",
// picture: "saint_cosme.jpg"
// },
// {
// name: "LAN RIOJA CRIANZA",
// year: "2006",
// grapes: "Tempranillo",
// country: "Spain",
// region: "Rioja",
// description: "A resurgence of interest in boutique vineyards...",
// picture: "lan_rioja.jpg"
// }];
// db.collection('wines', function(err, collection) {
// collection.insert(wines, {safe:true}, function(err, result) {});
// });