You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacOS Monterey下Homebrew安装MongoDB后缺少mongo命令的问题

解决MongoDB 6.0在MacOS Monterey下缺少mongo命令的问题

问题原因

MongoDB 6.0及以上版本,官方将mongo shell从mongodb-community主包中拆分出来,作为独立的mongodb-community-shell包发布,因此通过Homebrew安装主包后不会默认包含mongo命令。

解决步骤

  • 安装对应版本的MongoDB Shell:
    brew install mongodb-community-shell@6.0
    
  • 验证安装:
    安装完成后,直接在终端执行mongosh(官方推荐的新版shell)或mongo(旧版命令,为mongosh的软链接)即可启动MongoDB交互shell。

内容的提问来源于stack exchange,提问作者user19829881

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.21 16:18:19