问题
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