3

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.

1

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

Is there any way to do this from a client? If you're running mongo from a remote instance, you don't have the file structure to get the bin functions.
No, it's a separately utility and not supported by the node.js driver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.