我正在关注docs的教程.mongodb.org,我已经完成了第一个教程,那就是在Windows机器上安装mongodb.我现在处于第二阶段,即将开始mongodb开发.

我被困在本节的第一个阶段,它指示我在系统提示符中键入mongo.当我这样做时,我只会收到一条错误消息,上面说:

'mongo' is not recognized as an internal or external command, operable program or batch file

我知道这可能是我做错的一件很简单的事情,有人有什么 idea 吗?

推荐答案

你需要先在一个cmd窗口中运行mongod,然后打开另一个窗口并键入mongo.确保也更新了Windows Path环境变量,这样就不必导航到所有mongo二进制文件所在的目录来启动应用程序.要更新Path变量,请执行以下操作:

Go to Control Panel > System & Security > System > Advanced System Settings > Environment Variables > navigate to the Path variable hit Edit and add ;C:\mongodb to the Path (or whatever the directory name is where MongoDB is located (the semi-colon delimits each directory).

Mongodb相关问答推荐

MongoDB:子文档中仅存在于父文档中的返回字段?

用其他集合中的文档替换嵌套文档数组中的值

如何使用MongoDB对子文档进行条件投影?

MongoDB - 将对象转换为数组

$lookup 的参数必须是字符串

MongoDB - 分组并找到前 N 个

使用名为 Object 键的 uuid 创建 mongodb 文档

使用 mongodb 时是否需要规范化数据库?

使用 Node.js 通过 SSL 连接到 MongoDB

使用 homebrew 和 Xcode 8.1.1 安装 Mongodb 失败

findOneAndUpdate 和 findOneAndReplace 有什么区别?

MongoDB:按标签获取文档

使用 Node.js 和 mongodb 处理超时

将数据插入 MongoDB - 没有错误,没有插入

如何在array.NET驱动程序中的元素属性上创建MongoDB MultiKey索引

填充mongoose后查找

如何将转储文件夹导入 mongodb 数据库?

在 mongoose 中使用 UUID 进行 ObjectID 引用

无法在 mac os 10.9 上安装 mongodb php 驱动程序

Mongodb 查找除一两个条件之外的所有内容