Skip to content

Instantly share code, notes, and snippets.

@dearfrankg
Last active September 8, 2016 23:34
Show Gist options
  • Select an option

  • Save dearfrankg/577618d7e5ac87e6f41494fdc53b163a to your computer and use it in GitHub Desktop.

Select an option

Save dearfrankg/577618d7e5ac87e6f41494fdc53b163a to your computer and use it in GitHub Desktop.
Add some test data for CoffeeShop /server/boot/create-sample-models.js
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