在mongo 3.0的操作
備份示例
./mongodump -h localhost -d liongo -o ./
錯誤方式:
./mongorestore -h 127.0.0.1 -d liongo --directoryperdb /home/zhoudazhuang/company-zhoudazhuang/liongo/note.bson
會報錯:
2017-01-27T15:31:54.217+0800 error parsing command line options: --dbpath and related flags are not supported in 3.0 tools. See http://dochub.mongodb.org/core/tools-dbpath-deprecated for more information 2017-01-27T15:31:54.217+0800 try 'mongorestore --help' for more information
使用mongorestore –help,正確還原方式為(去掉–directoryperdb):
./mongorestore -h 127.0.0.1 -d liongo /home/zhoudazhuang/company-zhoudazhuang/liongo/note.bson --drop
too many positional arguments錯誤
在window下mongodb默認安裝在c盤的Program Files文件下
這個文件名中間有個空格 就導致了接下來too many positional arguments錯誤的產生
