本文介绍了从javascript Node.js调用mongoexport的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将Mongo集合导出到.csv。 Mongo为此提供了一个解决方案,但它仅限于shell。
I would like to export a Mongo Collection to an .csv. Mongo provides a solution for this but it is limited to the shell.
我使用本机驱动程序node.js,并希望能够在脚本中执行此操作,而不是从shell中调用。
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.
推荐答案
你只是想从node.js应用程序中运行 mongoexport
命令,可以使用。
If you're just looking to run the mongoexport
command from your node.js app, you can use child_process.spawn
to do that.
这篇关于从javascript Node.js调用mongoexport的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!