问题描述
MongoDB的新手.我正在关注本教程,当出现以下错误时尝试按照步骤2进行操作.我将命令放入Windows命令提示符,并将目录设置为"mongoimport"文件(C:\ MongoDB)的位置.我还在PATH中包含了相同的目录,并且Primer-dataset.json文件保存在该位置.我相当有信心MongoDB安装正确.
New to MongoDB. I'm following this tutorial, and I get the above error when trying to follow Step 2. I'm putting the command into a Windows Command Prompt, and I've set my directory to the location of the 'mongoimport' file (C:\MongoDB). I've also included the same directory in my PATH, and the primer-dataset.json file is saved in that location. I'm fairly confident MongoDB is installed properly.
推荐答案
来自版本 4.4.0 您必须单独安装MongoDB数据库工具,在此处中提到.
From Version 4.4.0You have to install the MongoDB Database Tools separately, mentioned here.
安装.然后转到目录的bin目录工具(主要是C:\ Program Files \ MongoDB \ Tools \ [版本] \ bin),然后在此处打开命令提示符.
To install.Then to go the bin directory of Tools (mostly C:\Program Files\MongoDB\Tools\[version]\bin) and open command prompt there.
现在在此处执行命令.如上面的 Cody 所述,这应该可以起作用,或者在开头添加.\
.
Now execute the command here. This should work or else add .\
in the beginning as mentioned by Cody w above.
如果要从当前路径(不仅是大多数路径:C:\ Program Files \ MongoDB \ Tools ... \ bin路径)执行命令,可以执行此链接的第3步(在您的PATH中提供数据库工具)
If you want to execute your command from your current path (not only from mostly: C:\Program Files\MongoDB\Tools...\bin Path), you can do step 3 of this link (Make the DB Tools available in your PATH)
这篇关于获取“'mongoimport'未被识别为内部或外部命令,可操作程序或批处理文件".尝试从文件导入数据时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!