Can mongorestore take a single url argument instead of separate arguments?

两盒软妹~` 提交于 2019-11-29 06:55:54
acemtp

I didn't find a way to pass the URL as a parameter but I wrote a one line command that converts the url into mongorestore parameters:

CMD=`meteor mongo -U autocomplete.meteor.com | tail -1 | sed 's_mongodb://\([a-z0-9\-]*\):\([a-f0-9\-]*\)@\(.*\)/\(.*\)_mongorestore -u \1 -p \2 -h \3 -d \4_'`
$CMD /path/to/dump

Update since five years ago:

Beginning with version 3.4.6, mongorestore accepts a URI argument:

https://docs.mongodb.com/manual/reference/program/mongorestore/#options

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