-
Notifications
You must be signed in to change notification settings - Fork 61
Add MongoDB Shell (mongosh) installation support #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
…alidation Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
7e02434 to
b9c9651
Compare
thanks copilot closes #160
9adb4e0 to
0468c7d
Compare
0468c7d to
ef4abbd
Compare
|
@copilot Review and update this PR description to accurately reflect the changes. |
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
Updated the PR description to accurately reflect the implementation. Key changes:
All documentation (README and help text) now matches the actual implementation. Commit: aa0780d Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Overview
This PR adds the ability to install and manage MongoDB Shell (mongosh) versions directly through the
mtool, addressing issue #160. Users can now install mongosh just like they install MongoDB server and Database Tools.Motivation
MongoDB Shell (mongosh) is released separately from the MongoDB server starting with MongoDB 6.0+. Previously, users had to manually install mongosh via package managers (e.g., brew on macOS) or download it manually. This PR brings mongosh management into the
mtool, providing a consistent interface for managing all MongoDB components.New Features
MongoDB Shell Installation Commands
Enhanced Shell Execution
The
m shell <version> [args...]command now intelligently handles both mongosh and legacy mongo shells:mongoshell from the MongoDB server installation if mongosh is not installedDatabase Tools Enhancement
Added
rmsupport for Database Tools:# Remove Database Tools versions $ m tools rm 100.9.0 100.9.1Implementation Details
The implementation follows the same patterns established for Database Tools management:
Core Functions:
SHELL_DIRconfiguration variable for version storage ($M_PREFIX/m/shell/versions/)get_all_shell_versions()fetches available versions from mongodb-js/mongosh GitHub releasesinstall_shell_bin()downloads and installs mongosh binaries from downloads.mongodb.com/compassinstall_shell()activates a specific mongosh versioncheck_current_shell_version()detects the currently active versionlist_shell_versions()anddisplay_shell_versions()provide version listingsremove_shell_versions()removes installed mongosh versionshandle_mongosh()dispatches mongosh subcommandsPlatform Support:
UX Improvements:
m mongoshshows installed versions (consistent withmandm tools)m,m tools, andm mongoshBackward Compatibility
The implementation maintains full backward compatibility:
m shell <version> [args...]continues to work, now with intelligent mongosh/mongo fallbacks,sh,mongo) continue to workTesting
Added comprehensive test coverage in
test/suite.mjs:Documentation
Updated both inline help (
m --help) and README.md with:Example Usage
Fixes #160
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.