mongodump “Failed: bad option: can only dump a single collection to stdout”

孤者浪人 提交于 2019-12-13 20:19:50

问题


mongodump --out "-" 

doesn't work, it gives me this message : "Failed: bad option: can only dump a single collection to stdout". What happens ?...


回答1:


so the exception is self-explanatory that if you use --out "-" it can show only single collection on stdout.

So i would like to know as to what you want to achieve?

if you want to stdout a particular collection command is :

mongodump -o - -d <dbname> -c <collection name>

if you want to take dump of whole mongodatabase ideal command is:

mongodump --gzip --archive=db.tar


来源:https://stackoverflow.com/questions/52540104/mongodump-failed-bad-option-can-only-dump-a-single-collection-to-stdout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!