Skip to content

Latest commit

 

History

History
19 lines (18 loc) · 434 Bytes

README.md

File metadata and controls

19 lines (18 loc) · 434 Bytes

Export the mongodb collection to csv or json

Usage

 $ npm install mongotojson --save
var convert = require('mongotojson');
var options = {
	database: 'product', // required
	collection: 'users', // required
	fields: ['name','address'], // optional
	output: './output/users.csv or .json', // required
};
convert.export(options, function (err, success) {
	console.log(err);
	console.log(success);
});
``