百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

mongosh

> 前端框架
开源

MongoDB Shell

395 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

MongoDB Shell

mongosh

Evergreen Waterfall CI

The MongoDB Shell

This repository is a monorepo for all the various components in the MongoDB Shell across all environments (REPL, Browser, Compass, etc).

For our official documentation, please visit MongoDB Docs page.

MongoDB Shell works with MongoDB servers >= 4.0.

Installation

You can get the release tarball from our Downloads Page. We currently maintain MongoDB Shell on three different platforms - Windows (zip), MacOS (zip) and Linux (tgz, deb and rpm). Once downloaded, you will have to extract the binary and add it to your PATH variable. For detailed instructions for each of our supported platforms, please visit installation documentation.

Alternatively:

  • Run npx mongosh to run mongosh without a full installation. This is easiest if you already have npm installed.
  • Run download_latest.sh to download a mongosh binary. You can use the following script:
bash
curl -fsSL https://raw.githubusercontent.com/mongodb-js/mongosh/refs/heads/main/download_latest.sh | sh

CLI Usage

…

Local Development

Requirements

  • Node.js v24.x

Install

bash
npm run bootstrap
npm run compile-cli

Running Tests

Run all tests (this may take some time):

bash
npm test

Run tests from a specific package:

bash
npm -w @mongosh/cli-repl run test

To test against a specific version, the MONGOSH_SERVER_TEST_VERSION environment variable can be set to a semver string specifying a server version, e.g. MONGOSH_SERVER_TEST_VERSION='>= 7.0.0-rc0' npm -w @mongosh/cli-repl run test.

Starting the CLI

Via npm:

bash
npm run start 

This will compile all Typescript dependencies of the CLI package first.

Alternatively you can also run start inside the cli-repl package, if you're sure everything else is compiled:

bash
npm run -w @mongosh/cli-repl start 

Compiling

Compile all Typescript:

bash
npm run compile

Compile just the CLI ands its dependencies:

bash
npm run compile-cli

Compile the standalone executable (this may take some time):

bash
npm run compile-exec

Relevant environment variables for compiling are:

  • NODE_JS_VERSION: Specify a Node.js version to use for compilation, e.g. 16.15.0 or 16.x
  • BOXEDNODE_CONFIGURE_ARGS: Node.js configure flags as a comma-separated list or JSON array, e.g. --shared-openssl,--shared-zlib
  • BOXEDNODE_MAKE_ARGS: Node.js make args (no distinction from BOXEDNODE_CONFIGURE_ARGS on Windows) as a comma-separated list or JSON array, e.g. -j12

Compile a specific package, e.g. the .deb for Debian:

bash
npm run compile-exec
npm run evergreen-release package -- --build-variant=deb-x64

Compilation and packaging output is written to dist/.

Releasing

Refer to the build package documentation.

Contributing

For issues, please create a ticket in our JIRA Project.

For contributing, please refer to CONTRIBUTING.md.

Is there anything else you’d like to see in MongoDB Shell? Let us know by submitting suggestions in our feedback forum.

License

Apache-2.0

Issues· 26 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcompasscompass-plugindrivermongodb

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架