2

How to perform import and export operation in MongoDB using Node.js? The code which we use in MongoDB for this is

mongoimport --collection Newimport --file filename.json
mongoexport --db test --collection CollectionName --out outputFileName.json

I need to perform this using Node.js

1
  • Off-topic for this board - not a programming question. (Not your downvoter, just explaining why...) Commented Jan 7, 2015 at 6:41

1 Answer 1

5

Try to create Child process in NodeJS and try execute mongoimport or mongoexport commands

More on this on following links :

http://nodejs.org/api/child_process.html

http://krasimirtsonev.com/blog/article/Nodejs-managing-child-processes-starting-stopping-exec-spawn

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.