mongoose-faker
mongoose-faker
is a small library to generate dump data using mongoose models.
Installation
npm install --save mongoose-faker
Usage
Quick usage
const faker = ; // Creata a document and save it to the dbconst student = await faker; // You can also pass in custom fields to your modelconst course = await faker;
Using sessions
Sometimes you may create lots of data and desire to clean up the db right after you are done. You can use session to accomplish that.
const faker = ;
Credits
Most of the code came from This repository. Thanks to The D. GmbH for making it available in the first place.