@@ -8,3 +8,88 @@ npm i -g mongosh
8
8
9
9
This package is a convenience distribution of mongosh. To download a fully supported version
10
10
of mongosh, visit https://www.mongodb.com/try/download/shell .
11
+
12
+ ## Usage
13
+
14
+ ## CLI Usage
15
+
16
+ <!-- AUTOMATICALLY_INSERT_CLI_USAGE -->
17
+
18
+ ``` shell
19
+ $ mongosh [options] [db address] [file names (ending in .js or .mongodb)]
20
+
21
+ Options:
22
+
23
+ -h, --help Show this usage information
24
+ -f, --file [arg] Load the specified mongosh script
25
+ --host [arg] Server to connect to
26
+ --port [arg] Port to connect to
27
+ --build-info Show build information
28
+ --version Show version information
29
+ --quiet Silence output from the shell during the connection process
30
+ --shell Run the shell after executing files
31
+ --nodb Don' t connect to mongod on startup - no ' db address' [arg] expected
32
+ --norc Will not run the ' .mongoshrc.js' file on start up
33
+ --eval [arg] Evaluate javascript
34
+ --json[=canonical|relaxed] Print result of --eval as Extended JSON, including errors
35
+ --retryWrites[=true|false] Automatically retry write operations upon transient network errors (Default: true)
36
+
37
+ Authentication Options:
38
+
39
+ -u, --username [arg] Username for authentication
40
+ -p, --password [arg] Password for authentication
41
+ --authenticationDatabase [arg] User source (defaults to dbname)
42
+ --authenticationMechanism [arg] Authentication mechanism
43
+ --awsIamSessionToken [arg] AWS IAM Temporary Session Token ID
44
+ --gssapiServiceName [arg] Service name to use when authenticating using GSSAPI/Kerberos
45
+ --sspiHostnameCanonicalization [arg] Specify the SSPI hostname canonicalization (none or forward, available on Windows)
46
+ --sspiRealmOverride [arg] Specify the SSPI server realm (available on Windows)
47
+
48
+ TLS Options:
49
+
50
+ --tls Use TLS for all connections
51
+ --tlsCertificateKeyFile [arg] PEM certificate/key file for TLS
52
+ --tlsCertificateKeyFilePassword [arg] Password for key in PEM file for TLS
53
+ --tlsCAFile [arg] Certificate Authority file for TLS
54
+ --tlsAllowInvalidHostnames Allow connections to servers with non-matching hostnames
55
+ --tlsAllowInvalidCertificates Allow connections to servers with invalid certificates
56
+ --tlsCertificateSelector [arg] TLS Certificate in system store (Windows and macOS only)
57
+ --tlsCRLFile [arg] Specifies the .pem file that contains the Certificate Revocation List
58
+ --tlsDisabledProtocols [arg] Comma separated list of TLS protocols to disable [TLS1_0,TLS1_1,TLS1_2]
59
+ --tlsUseSystemCA Load the operating system trusted certificate list
60
+ --tlsFIPSMode Enable the system TLS library' s FIPS mode
61
+
62
+ API version options:
63
+
64
+ --apiVersion [arg] Specifies the API version to connect with
65
+ --apiStrict Use strict API version mode
66
+ --apiDeprecationErrors Fail deprecated commands for the specified API version
67
+
68
+ FLE Options:
69
+
70
+ --awsAccessKeyId [arg] AWS Access Key for FLE Amazon KMS
71
+ --awsSecretAccessKey [arg] AWS Secret Key for FLE Amazon KMS
72
+ --awsSessionToken [arg] Optional AWS Session Token ID
73
+ --keyVaultNamespace [arg] database.collection to store encrypted FLE parameters
74
+ --kmsURL [arg] Test parameter to override the URL of the KMS endpoint
75
+
76
+ DB Address Examples:
77
+
78
+ foo Foo database on local machine
79
+ 192.168.0.5/foo Foo database on 192.168.0.5 machine
80
+ 192.168.0.5:9999/foo Foo database on 192.168.0.5 machine on port 9999
81
+ mongodb://192.168.0.5:9999/foo Connection string URI can also be used
82
+
83
+ File Names:
84
+
85
+ A list of files to run. Files must end in .js and will exit after unless --shell is specified.
86
+
87
+ Examples:
88
+
89
+ Start mongosh using ' ships' database on specified connection string:
90
+ $ mongosh mongodb://192.168.0.5:9999/ships
91
+
92
+ For more information on usage: https://docs.mongodb.com/mongodb-shell.
93
+ ```
94
+
95
+ <!-- /AUTOMATICALLY_INSERT_CLI_USAGE -->
0 commit comments