1.0.1 • Published 6 years ago

fill-db v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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