Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call mongoexport from javascript Node.js

I would like to export a Mongo Collection to an .csv. Mongo provides a solution for this but it is limited to the shell.

http://docs.mongodb.org/manual/reference/mongoexport/

I'm using the native driver for node.js and would like to be able to do this in a script as opposed to being invoked from the shell.

like image 466
Josh Elias Avatar asked Jul 18 '26 17:07

Josh Elias


1 Answers

If you're just looking to run the mongoexport command from your node.js app, you can use child_process.spawn to do that.

like image 129
JohnnyHK Avatar answered Jul 20 '26 07:07

JohnnyHK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!