commit | author | age | ||
6ef0cc | 1 | /** |
D | 2 | * Populate DB with sample data on server start |
3 | * to disable, edit config/environment/index.js, and set `seedDB: false` | |
4 | */ | |
5 | ||
6 | 'use strict'; | |
7 | ||
c382ab | 8 | const Todo = require('../api/todo/todo.model'); |
6ef0cc | 9 | |
D | 10 | Todo.find({}).remove(function() { |
11 | Todo.create({ | |
a07ebe | 12 | title : 'Learn some stuff about MongoDB', |
6ef0cc | 13 | completed: false |
a07ebe | 14 | }, { |
D | 15 | title : 'Play with NodeJS', |
16 | completed: true | |
6ef0cc | 17 | }); |
D | 18 | }); |