fill-db

1.0.1 • Public • Published

fill-db

For those who are tired of filling db with fake values just to check API

How to use

npm install --save fill-db

Fill database directly

const filldb = require('fill-db');
 
var options = {
    url:'mongodb://localhost:27010/', //Optional, default: mongodb://localhost:27010/
    database:'sampleDatabase', //Required.
    collection:'user', //Required. 
    schema:{ //Required. the structure that needs to be filled
        name:"some name",
        email:"some email",
        contactNo:1234567890,
        password:"some text"
    },
    count:25 //Optional, default: 10
}
 
filldb.db(options)
 

Fill database using API

const filldb = require('fill-db');
 
var options = {
    host: 'localhost', //Optional, default: localhost
    port: 3000, //Optional, default: 3000
    path: '/user', //Required. if no path available provide '/'
    schema:{ //Required. the structure that needs to be filled
        name:"some name",
        email:"some email",
        contactNo:1234567890,
        password:"some text"
    },
    count:25 //Optional, default: 10
}
 
filldb.api(options)
 

License

MIT

Package Sidebar

Install

npm i fill-db

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

7.72 kB

Total Files

4

Last publish

Collaborators

  • jugnuagrawal