browseDownload binary →
mongosh/MongoDB Shell
MongoDBModern interactive shell for MongoDB with syntax highlighting, autocompletion, and built-in help.
Databases & DataJSON
01Install
brew install mongosh02Global Flags
| Flag | Type | Description |
|---|---|---|
--host | string | MongoDB server host |
--port | string | MongoDB server port |
--username/-u | string | Authentication username |
--password/-p | string | Authentication password |
--eval | string | Evaluate a JavaScript expression |
--quiet | boolean | Suppress startup messages |
03Authentication
Methods
connection-stringenvironment-variables
Env vars
MONGOSH_URIMONGODB_URISetup
mongosh mongodb://localhost:2701704Capabilities
Reference
binary
mongoshcheck
mongosh --versionauth
connection-string, environment-variablesformats
text, ejsonjson flag
--json=relaxed