# 使用 Homebrew, Nix, scoop 安装 mongosh

查看 mongosh 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:mongosh
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install mongosh
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#mongosh
```

  证据: nixpkgs package indexes: pkgs/by-name/mo/mongosh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

### Windows

- Scoop (92%):

```sh
scoop install extras/mongosh
```

  证据: Scoop official bucket manifest trees: bucket/mongosh.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:mongosh
- **软件包管理器:** Homebrew
- **版本:** 2.9.2
- **来源摘要:** MongoDB Shell to connect, configure, query, and work with your MongoDB database
- **主页:** <https://www.mongodb.com/try/download/shell>
- **最后更新:** 2026-07-20T13:51:29-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- mongosh (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.9.2
## 项目历史与用法

mongosh is the MongoDB Shell, MongoDB's modern JavaScript and Node.js REPL for interacting with MongoDB deployments in Atlas, local installations, or remote hosts. MongoDB introduced the first preview on 2020-06-08 after deciding that extending the legacy mongo shell was not the right path for a growing MongoDB platform.

### 项目历史

The redesign focused on a shell that could be extensible, embeddable in other products, and easier to use in terminals. The public changelog records mongosh v1.0 on 2021-07-09, after a preview series that added features such as transactions support, AWS IAM authentication, script loading, --eval, .mongoshrc.js customization, MongoDB 5.0 support, Stable API-aware autocomplete, and snippets. The GitHub repository is a monorepo for shell components across REPL, browser, Compass, and related environments.

### 使用方式

Users run mongosh to test queries, inspect and change data, configure settings, and script database operations with shell helpers on top of the MongoDB driver. MongoDB distributes it as an Apache-2.0 standalone product separate from the MongoDB Server, and package managers such as Homebrew, Nix, and Scoop make it available independently from server releases.

### 来源

- <https://formulae.brew.sh/formula/mongosh>
- <https://github.com/mongodb-js/mongosh>
- <https://www.mongodb.com/company/blog/product-release-announcement/introducing-the-new-shell>
- <https://www.mongodb.com/docs/mongodb-shell/>
- <https://www.mongodb.com/docs/mongodb-shell/changelog/>
- <https://www.mongodb.com/try/download/shell>


## 安全说明

broad file, network, media, or database tool signal. generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- broad file, network, media, or database tool signal
- generalized runtime or code generation signal

## 其他软件包管理器记录

- Nix - mongosh: normalized package name match | nixpkgs package indexes: pkgs/by-name/mo/mongosh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Scoop - extras/mongosh: normalized package name match | Scoop official bucket manifest trees: bucket/mongosh.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/mongosh.yml](https://github.com/mxcl/pkgdb/blob/main/combined/mongosh.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
