mongodb 是否可以为 mongodump 指定目录/文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10128719/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to specify a directory/folder for mongodump?
提问by ericsoco
回答by Justin Jenkins
You don't need a script. From the docs:
你不需要脚本。从文档:
--out <path>, -o <path>
Specifies the directory where mongodump will write BSON files for the dumped databases.
--out <path>, -o <path>
指定 mongodump 将为转储的数据库写入 BSON 文件的目录。
Example:
例子:
mongodump -o /mydir/
Lots of other options there, check it out.
那里有很多其他选择,请查看。
回答by JavaadPatel
You can view all the commands for mongodump by typing "mongodump --help" in the command prompt (NB. You have to be in the folder that contains mongodump.exe).
您可以通过在命令提示符下键入“mongodump --help”来查看 mongodump 的所有命令(注意,您必须位于包含 mongodump.exe 的文件夹中)。
You can use a command like:
您可以使用如下命令:
mongodump /host <hostIP> /port <port> /d <database> /c <collection> /o <outputDirectoryPath>