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.
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:
npx mongosh to run mongosh without a full installation. This is
easiest if you already have npm installed.download_latest.sh to download a mongosh binary. You can use
the following script:curl -fsSL https://raw.githubusercontent.com/mongodb-js/mongosh/refs/heads/main/download_latest.sh | sh…npm run bootstrap
npm run compile-cliRun all tests (this may take some time):
npm testRun tests from a specific package:
npm -w @mongosh/cli-repl run testTo 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.
Via npm:
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:
npm run -w @mongosh/cli-repl start Compile all Typescript:
npm run compileCompile just the CLI ands its dependencies:
npm run compile-cliCompile the standalone executable (this may take some time):
npm run compile-execRelevant environment variables for compiling are:
NODE_JS_VERSION: Specify a Node.js version to use for compilation, e.g. 16.15.0 or 16.xBOXEDNODE_CONFIGURE_ARGS: Node.js configure flags as a comma-separated list
or JSON array, e.g. --shared-openssl,--shared-zlibBOXEDNODE_MAKE_ARGS: Node.js make args (no distinction from BOXEDNODE_CONFIGURE_ARGS on Windows)
as a comma-separated list or JSON array, e.g. -j12Compile a specific package, e.g. the .deb for Debian:
npm run compile-exec
npm run evergreen-release package -- --build-variant=deb-x64Compilation and packaging output is written to dist/.
Refer to the build package documentation.
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.
暂无开放 Issues,或尚未同步最近议题。