mongoexport-wrapper
v1.0.1
Published
A wrapper around mongoexport command.
Downloads
8
Readme
mongoexport-wrapper
A node js wrapper around
mongoexport
command
Install
$ npm install --save mongoexport-wrapper
Usage
var mongoexport = require('mongoexport-wrapper');
var opt = {
host : '127.0.0.1:27017' //<hostname><:port> Default: localhost:27017
db : 'test',
collection :'user',
fields : "user,email,contact",
out : 'users.csv',
type : 'csv'
}
//mongoexport command should be in path variable
//all options for mongoexport command can be used
mongoexport(opt,(err,result)=>{
if(err) console.log(err);
else console.log(result);
});