我刚刚在我的工作站上安装了 MongoDB 5.0 版 CLI 工具。
但是现在当我像往常一样恢复数据库时,我得到一个错误:
mongorestore
mongorestore : The term 'mongorestore' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ mongorestore
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (mongorestore:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果我列出 MongoDB 5.0 bin 目录,这就是我所看到的:
Directory: D:\MongoDB\Server\5.0\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 7/19/2021 10:45 PM 1558 InstallCompass.ps1
-a---- 7/19/2021 11:10 PM 22162432 mongo.exe
-a---- 7/13/2021 2:24 PM 13275648 mongocli.exe
-a---- 7/26/2021 5:02 PM 577 mongod.cfg
-a---- 7/20/2021 12:14 AM 46752256 mongod.exe
-a---- 7/20/2021 12:14 AM 528224256 mongod.pdb
-a---- 7/19/2021 11:35 PM 29746688 mongos.exe
-a---- 7/19/2021 11:35 PM 311988224 mongos.pdb
我正在使用 Windows 10。我的信任mongorestore
和mongoimport
命令发生了什么?它们在版本 5 下不再可用。如何在 MongoDB 版本 5.0.1 下恢复数据库?