Created
March 9, 2012 03:00
-
-
Save dansteingart/2004796 to your computer and use it in GitHub Desktop.
Node Script for MongoExport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var child; | |
//Put path to mongoexport here | |
mel = "/Users/ardustat/Downloads/mongodb-osx-x86_64-2.0.2/bin/mongoexport" | |
function mongoexport(collection) | |
{ | |
out_string = mel + " -csv -o "+collection+".csv -d ardustat -c "+collection+" -f time,cell_potential,working_potential,current" | |
child = exec(out_string, function (error, stdout, stderr) | |
{ | |
console.log('stdout: ' + stdout); | |
console.log('stderr: ' + stderr); | |
if (error !== null) { | |
console.log('exec error: ' + error); | |
} | |
}) | |
} | |
mongoexport(process.argv[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment