Skip to content

Mongo-dummy faker based seeder package helps easily seed dummy data generated by mongo-dummy.

Notifications You must be signed in to change notification settings

leulseged3/mongoose-dummy-seeder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoose-dummy-seeder

Mongo-dummy faker based seeder package helps easily seed dummy data generated by mongo-dummy.

Installation

$ npm install --save-dev mongoose-dummy-seeder

Configuration

Create .env file in the root folder and insert written below

MONGO_HOST = mongodb://localhost:27017 //your mongodb host and port
MONGO_DB = database_name //your database name

Inside scripts in package.json add

"seeder": "node node_modules/mongoose-dummy-seeder/index.js"

Usage

create new seed

Inside root folder of your project run

 $ npm run seeder

then run

seeder $ create-seed filename

seed will be created inside src/seeds folder

seed the seed file

open the created seed inside src/seeds

import your mongoose model

eg

const model = require('path-to-your-model');

add ignorable fields in the ignoredFields array

const ignoredFields = ['_id','__v'];

and edit number_of_dummy_data

const number_of_dummy_data = 10;//as much as you want

after that run

seeder $ seed filename

License

MIT License

Author

Leulseged Tilahun

About

Mongo-dummy faker based seeder package helps easily seed dummy data generated by mongo-dummy.

Resources

Stars

Watchers

Forks

Packages

No packages published