mongosh
Changelog
On this page
v1.4.2
Released May 17, 2022
- MONGOSH-1139 - Adds Debian 11 support for
mongosh
. - MONGOSH-1183 -
cursor.allowDiskUse()
now acceptstrue
orfalse
. - MONGOSH-1204 - Adds visual identifier for Queryable
Encyption collections in
show collections
. - MONGOSH-1207 - Adds Queryable Encryption helpers.
v1.4.1
Released May 12, 2022
- MONGOSH-1118 - Bundles and uses a CSFLE shared library in
place of
mongocryptd
. - MONGOSH-1217 - Introduces partial support for Queryable Encryption.
- MONGOSH-1178 - Uses Node.js driver 4.6.0.
v1.3.1
Released March 21, 2022
- MONGOSH-1163 -
mongosh
now uses Node.js 14.19.1. Node 14.19.1 includes an OpenSSL version that addresses CVE-2022-0778.
v1.3.0
Released March 17, 2022
- MONGOSH-856 - Kerberos feature parity with the legacy shell is done now, with the last command line option now also working as it did in the legacy shell.
- MONGOSH-1013 - KMIP support for CSFLE. More specifically, you can provide per-KMS-provider TLS options when creating your CSFLE-enabled connections now.
- MONGOSH-1151 - Support for snapshot reads, now also in mongosh.
v1.2.3
Released March 10, 2022
- MONGOSH-1121 - Support the
commitQuorum
parameter for thecreateIndexes()
method.
v1.2.2
Released February 25, 2022
- MONGOSH-1134 - Internal bug fix required to re-enable Homebrew installation.
v1.2.1
Released February 24, 2022
- MONGOSH-1063 - You can now create a global
monogosh
configuration file. - MONGOSH-959 – You can now use the config.reset method to reset a configuration setting to the default value.
- MONGOSH-1133 –
mongosh
adds a--tlsUseSystemCA
option that causesmongosh
to attempt to load system certificates as well as the built-in certificates.
v1.1.9
Released January 18, 2022
New features in this release:
- MONGOSH-1015 –
mongosh
no longer overridesappName
if it was present in the connection string. - MONGOSH-1073 – You can now pass BSON number objects to the
legacy BSON number constructors. For example,
NumberInt(NumberInt(n))
now works like it did in the legacy shell.
v1.1.8
Released January 11, 2022
New features in this release:
mongosh
now uses Node.js driver 4.3.0.- Provides PGP signatures for uploaded tarballs.
v1.1.7
Released December 14, 2021
mongosh
now uses Node.js driver 4.2.2.- Minor bug fixes.
v1.1.6
Released December 2, 2021
New features in this release:
mongosh
now uses Node.js driver 4.2.1.
Bug fixes in this release:
- Fixes the way
try
,catch
,finally
works if no exception was thrown in thetry
block.
v1.1.5
Released December 1, 2021
Minor bug fixes.
v1.1.4
Released November 24, 2021
Minor bug fixes.
v1.1.2
Released November 5, 2021
New features in this release:
mongosh
now uses the following driver versions:mongosh
release tarballs now include manpages.
v1.1.1
Released October 28, 2021
- Provides autocompletion for additional aggregation stages.
- Minor bug fixes.
v1.1.0
Released October 7, 2021
New features in this release:
- Adds support for the
edit
command and$EDITOR
variable. - Auto-complete for databases and collections is now case-insensitive.
v1.0.7
Released September 22, 2021
New features in this release:
mongosh
now uses the following driver versions:
v1.0.6
Released September 14, 2021
New features in this release:
- You can now run
sh.status()
when not connected to amongos
, for example when connected to a config server. db.setSecondaryOk()
,mongo.setSecondaryOk()
, andrs.secondaryOk()
methods are reintroduced but deprecated. These methods alias tomongo.setReadPref()
.- When you enter multiline input into the shell, single-line
// comments
are now preserved as/* comments */
in the history entry. - The Aggregation Pipeline parameter is now optional for
db.collection.watch()
,db.watch()
, andMongo.watch()
.
Bug Fixes in this Release:
v1.0.5
Released August 12, 2021
New features in this release:
You can use
config.set('maxTimeMS', <number>)
to set a defaultmaxTimeMS
value for operations.maxTimeMS
specifies a time limit in milliseconds within which the operation must complete.Noteconfig
settings persist across sessions.- On Windows, you can start
mongosh
by double-clicking on the.exe
file. When you do,mongosh
prompts you for a connection string to connect to your deployment. - The log files created by
mongosh
follow the format of themongod
,mongos
, ormongocryptd
. Meaning, the log files are newline-delimited JSON with the same set of fields used by the server.
v1.0.4
Released August 4, 2021
New features in this release:
mongosh
now uses version4.1.0
of the Node.js driver, with full support for connections to load balancers and MongoDB Atlas serverless instances.
Bug fixes in this release:
- The
Timestamp()
argument order is now reversed compared to previousmongosh
versions.
v1.0.3
Released July 29, 2021
Bug fixes in this release:
- Passing the exit code to
quit()
works like it does in the legacy shell. - Instances of
MaxListenersExceededWarning
are no longer emitted when methods likeconsole.log()
are used in loops. - When an internal error in
mongosh
occurs, the error message points you to the log file for the currentmongosh
session. - When printing the name of a collection (such as in response to
db.coll
), the database name is included in the output.
v1.0.1
Released July 21, 2021
New features in this release:
- Adds full support for the
--host
flag. - Adds the
--build-info
flag which provides detailed information about themongosh
version. - When using Kerberos,
mongosh
will now make use of tokens if they are still valid. You no longer need to specify a password when using valid tokens.
Bug fixes in this release:
- An issue that sporadically resulted in an
AcquireCredentialsHandle
error on Kerberos was fixed. - Miscellaneous other improvements.
v1.0
Released July 9, 2021
New features in this release:
- All the static methods of the Node.js driver BSON classes are now
available. Specifically, you can use
ObjectId.createFromTime(unixTimestampSeconds)
instead of the legacy shell’sObjectId.fromDate(dateObj)
. - When connected to an Atlas deployment, the default
mongosh
prompt displaysAtlas
instead ofEnterprise
. - The cursor referred to when
using
it
is cleared when eitherdb
is reassigned ordb.auth()
/db.logout()
is called. - Minor bug fixes and improvements.
v0.15.4
Released July 1, 2021
New features in this release:
mongosh
now color coordinates matching brackets.
v0.15.3
Released June 25, 2021
New features in this release:
mongosh
now shows the current database name in prompt by default.
v0.15.1
Released June 22, 2021
New features in this release:
.tar
and.zip
mongosh
download archives now include a parent directory.- Autocomplete is now aware of the
--apiStrict
flag. When--apiStrict
istrue
, autocomplete only completes methods that work with your defined API version. For more information, see Stable API. - Snippets. An experimental feature that allows users to create custom shell extensions.
Bug fixes in this release:
mongosh
can now connect to a replica set containing unhealthy nodes.
v0.14.0
Released May 28, 2021
New features in this release:
- When you run
show collections
, the type of collection is shown in the output. - Adds
sh.reshardCollection()
for resharding support. - Adds
inspectCompact
option to the configuration API to print each document field on its own line.
v0.13.1
Released May 18, 2021
New features in this release:
- When you use
Ctrl+C
to interrupt an operation, you interrupt operations that are running on the server, and not just local JavaScript execution. - .editor sessions are aggregated into one item in shell history.
- Build and publish packages for all platforms in the current MongoDB 5.0 server support matrix.
- Publish Windows MSI to the download center.
- Adds a customizable REPL prompt using
prompt
(or your .mongoshrc.js file). - When running against a MongoDB 5.0 deployment, shows reasons for document validation failures.
- Adds basic support for the
--apiStrict
flag. New connection methods:
Mongo.getDBNames()
returns a list of databases.Mongo.getDBs()
returns a document with a list of databases and metadata.
v0.12.1
Released April 30, 2021
New features in this release:
- Adds support for the
db.hello()
shell method andhello
database command. Use these commands in place ofisMaster
. - Extends the shell customization API to allow controlling log verbosity.
- Adds autocomplete for
show
anduse
commands. For example,show collections
anduse test
.
Bug fixes in this release:
collStats
now works properly on sharded collections.
v0.12.0
Released April 23, 2021
- New async rewriter, allowing for a much wider range of JavaScript features in the shell.
- Connection failure response is now more prompt if a connection is deemed unlikely to succeed.
- Adds new API for shell customization.
v0.11.0
Released April 8, 2021
Internal improvements and various bug fixes.
v0.10.1
Released April 1, 2021
Internal improvements.
v0.10.0
Released March 31, 2021
New features in this release:
- Support for loading a
.mongoshrc.js
file at startup. Use this file to bootstrap the shell with customizations and extended functionality. - Ability to load scripts from the command line.
- Support for
--eval
option. - Support for
--tlsCertificateSelector
on Windows and macOS.
Bug fixes in this release:
- Objects in explain output now properly expand.
v0.9.0
Released March 10, 2021
New features in this release:
- Support for the
load()
method. - Support for AWS IAM authentication.
Bug fixes in this release:
- Autocomplete works properly when connected to secondary node.
db.createUser()
on$external
database now handles password properly.- Miscellaneous other improvements.
v0.8.2
Released February 24, 2021
Minor internal improvements and bug fixes.
v0.8.1
Released February 22, 2021
Minor internal improvements and bug fixes.
v0.8.0
Released February 17, 2021
New features in this release:
- Support for Client-Side Field Level Encryption.
Bug fixes in this release:
- Running
setReadConcern
no longer reversesdb.auth()
authentication operations. - Pressing the backspace key in the password prompt no longer adds an asterisk, and now behaves as expected.
- Running
UUID()
without a value now generates a random UUID.
v0.7.7
Released February 3, 2021
New features in this release:
explain()
support for the following methods:- Support for specifying
cursor.batchSize()
, and typeit
for more. - Autocomplete for collection names.
Bug fixes in this release:
mongosh
no longer fails when connecting to a node in theSTARTUP2
state.mongosh
now properly displays startup warnings.explain()
on aggregations now return accurate and complete results.
v0.6.1
Released November 30, 2020
New features in this release:
- Support for readPreference methods.
- Support for the session object and related session object methods.
- Support for transaction methods.
Bug fixes and miscellaneous updates in this release:
- Remove support for deprecated 3.6 CRUD methods (
insert()
,remove()
,save()
, andupdate()
). - Fix an issue with loading JavaScript files into
mongosh
. - Fix an issue where when inserting many documents via a for loop, the loop would abort before all documents were inserted.
- Fix issue with output when printing result of a cursor.
- Update the Node REPL to use Node version 14.
v0.5.2
Released November 11, 2020
- Autocomplete now works properly when connected to a MongoDB 4.4.1 deployment.
- The
sh.status()
method now outputs correctly in the browser shell.
v0.5.0
Released October 12, 2020
- Adds support for replica set management methods.
- Adds support for sharded cluster management methods.
v0.4.2
Released October 1, 2020
Adds support for collection names with a dot. For example, to query a collection named
my.collection
, you can run:db.my.collection.findOne()
v0.4.0
Released September 15, 2020
Adds support for the following methods:
- Adds support for
maxAwaitTimeMS
for cursors.
v0.3.1
Released September 14, 2020
Improvements
This release adds support for:
- New
cursor
methods - Query
planCache
methods - Error helper methods
The following helper commands:
show users
show profile
show logs
show log[<name>]
This release includes an .rpm
artifact which can be downloaded from
the MongoDB Download Center.
Behavior Updates
Whenever a command's output includes { ok: 0 }
, mongosh
throws
an exception and does not return the raw output from the server.
The legacy mongo
shell error handling is not consistent between
commands. mongosh
standardizes the user-facing behavior for a
more consistent experience.
Bug Fixes
- MONGOSH-323: getUser() userId field is outputted as binary.
- MONGOSH-337: Linux tarball is not gzipped.
MONGOSH-341: Wrong values with NumberLong for numbers > Number.MAX_SAFE_INTEGER. As a result of this fix, values passed to
NumberLong
andNumberDecimal
must be strings.ImportantThe fix for MONGOSH-341 is a breaking change when compared to behavior in the legacy
mongo
shell.MONGOSH-346:
Ctrl+C
does not terminate the currently running command in the shell.NoteCtrl+C
terminates the process in the shell, but does not terminate the process on the MongoDB server.
v0.2.2
Released August 31, 2020
API Additions
This release adds support for the following APIs:
- Admin commands such as
db.killOp()
anddb.currentOp()
. More detail in MONGOSH-307. - Free monitoring commands such as
db.enableFreeMonitoring()
. More detail in MONGOSH-300. - Logging and profiling helper method implementations
(for example,
db.setLogLevel()
). More detail in MONGOSH-299. - Raw command execution methods helpers (e.g.
db.listCommands()
). More detail in MONGOSH-301. - Server stats commands such as
db.serverBuildInfo()
anddb.serverStatus()
. More detail in MONGOSH-304. - Bulk API support. Details in MONGOSH-296.
Bug Fixes
- Credentials are now properly redacted in logging and history.
Past Releases
For information on past releases, refer to mongosh Releases on GitHub.