npm.io
1.0.1 • Published 9 years ago

mongoexport-wrapper

Licence
MIT
Version
1.0.1
Deps
1
Vulns
0
Weekly
0
Stars
3

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);
});