Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. model.remove({}, (err, docs) => {
  2. if (err) {
  3. console.log('remove error');
  4. } else {
  5. console.log('remove success');
  6. model.insertMany(seeds, (insertError, insertedRecords) => {
  7. if (insertError) {
  8. console.log('insert error');
  9. } else {
  10. console.log('insert success');
  11. }
  12. });
  13. }
  14. });
  15.  
  16. model.collection.remove((removeError, removeResult) => {
  17. console.log('remove cb');
  18. model.collection.insert(seeds, (insertError, insertedRecords) => {
  19. console.log('insert cb');
  20. });
  21. });
  22.  
  23. const schema = new Schema({
  24. name: {type: String, unique: true, index: true},
  25. });
  26.  
  27. export default [
  28. {name: 'USA'},
  29. {name: 'Germany'},
  30. {name: 'France'}, ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement