如何导出/转储mongodb数据库? [英] How do I export/dump mongodb database?
本文介绍了如何导出/转储mongodb数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试了这样的mongo导出:
I tried a mongo export like this:
./mongodump --db local --collection lecturer
然后我尝试了:
./mongodump --db local --collection posts --out - > lecturer .csv
我收到同样的错误信息:语法错误:语法错误(shell):1
and I get the same error message: Syntax Error: syntax error (shell):1
- 我的代码出了什么问题?
- 导出成功后存储的数据在哪里?
推荐答案
mongodump
是一个命令行实用程序,它应该从系统命令提示符运行,而不是mongo javascript shell。
mongodump
is a command-line utility and it's supposed to be run from the system command prompt, not the mongo javascript shell.
./mongodump --db local --collection lecturer
如果成功,这个命令将在当前目录中的 dump
目录下创建一些文件。
if successful, this command will create some files under dump
directory in the current dir.
这篇关于如何导出/转储mongodb数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文