Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model.remove({}, (err, docs) => {
- if (err) {
- console.log('remove error');
- } else {
- console.log('remove success');
- model.insertMany(seeds, (insertError, insertedRecords) => {
- if (insertError) {
- console.log('insert error');
- } else {
- console.log('insert success');
- }
- });
- }
- });
- model.collection.remove((removeError, removeResult) => {
- console.log('remove cb');
- model.collection.insert(seeds, (insertError, insertedRecords) => {
- console.log('insert cb');
- });
- });
- const schema = new Schema({
- name: {type: String, unique: true, index: true},
- });
- export default [
- {name: 'USA'},
- {name: 'Germany'},
- {name: 'France'}, ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement