Last active
September 8, 2016 23:34
-
-
Save dearfrankg/577618d7e5ac87e6f41494fdc53b163a to your computer and use it in GitHub Desktop.
Add some test data for CoffeeShop /server/boot/create-sample-models.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(app) { | |
| app.dataSources.dsMongoDB.automigrate('CoffeeShop', function(err) { | |
| if (err) throw err; | |
| app.models.CoffeeShop.create([ | |
| {name: 'Bel Cafe', city: 'Vancouver'}, | |
| {name: 'Three Bees Coffee House', city: 'San Mateo'}, | |
| {name: 'Caffe Artigiano', city: 'Vancouver'}, | |
| ], function(err, coffeeShops) { | |
| if (err) throw err; | |
| console.log('Models created: \n', coffeeShops); | |
| }); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment