Skip to content

Commit 08b0e2e

Browse files
authored
Merge branch 'master' into DOCSP-46093-rn-2.3.5-2.3.7
2 parents b381c74 + 5174049 commit 08b0e2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1210
-90
lines changed

snooty.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "mongodb-shell"
2-
title = "MongoDB Shell"
2+
title = "mongosh"
33

44
intersphinx = [ "https://www.mongodb.com/docs/manual/objects.inv" ]
55

@@ -12,12 +12,14 @@ toc_landing_pages = ["/install",
1212
"/snippets",
1313
"/configure-mongosh",
1414
"/reference/configure-shell-settings",
15-
"/reference/ejson"
15+
"/reference/ejson",
16+
"/logs",
17+
"/logs/retention"
1618
]
1719

1820
[constants]
1921

20-
version = "2.3.2"
22+
version = "2.4.0"
2123
mdb-version = "8.0"
2224
pgp-version = "{+mdb-version+}"
2325
atlas = "MongoDB Atlas"

source/changelog.txt

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Release Notes
55
=============
66

7+
.. meta::
8+
:description: Explore the changelog for `mongosh`, detailing new features, bug fixes, and updates across various versions.
9+
710
.. default-domain:: mongodb
811

912
.. contents:: On this page
@@ -12,6 +15,126 @@ Release Notes
1215
:depth: 1
1316
:class: singlecol
1417

18+
19+
=======
20+
v2.5.0
21+
------
22+
23+
*Released April 9, 2025*
24+
25+
New features released in this version:
26+
27+
- :issue:`MONGOSH-1873` - Support new BSON vector types in mongosh
28+
- :issue:`MONGOSH-1649` - Add automerge information to sh.status()
29+
- :issue:`MONGOSH-1100` - Add Mongo bulkWrite API
30+
- :issue:`MONGOSH-1919` - Add sh.isConfigShardEnabled and listShards helpers
31+
32+
`Full release notes available on JIRA
33+
<https://jira.mongodb.org/issues/?jql=project%20%3D%20MONGOSH%20AND%20fixVersion%20%3D%202.5.0>`__.
34+
35+
v2.4.2
36+
------
37+
38+
*Released March 6, 2025*
39+
40+
New feature released in this version:
41+
42+
- :issue:`MONGOSH-1926` - Added the ``sh.moveRange`` helper method.
43+
44+
`Full release notes available on JIRA
45+
<https://jira.mongodb.org/issues/?jql=project%20%3D%20MONGOSH%20AND%20fixVersion%20%3D%202.4.2>`__.
46+
47+
v2.4.0
48+
------
49+
*Released February 24, 2025*
50+
51+
``mongosh`` now uses the following driver versions:
52+
53+
- `Node.js driver 6.13.0 <https://github.com/mongodb/node-mongodb-native/releases/tag/v6.13.0>`__.
54+
- `Node.js BSON package 6.10.3 <https://github.com/mongodb/js-bson/releases/tag/v6.10.3>`__.
55+
56+
New features released in this version:
57+
58+
- :issue:`MONGOSH-2013` - Added a ``history()`` command, which returns an array of
59+
all previously run commands.
60+
61+
- :issue:`MONGOSH-1090` - Added a ``log.getPath()`` command, which returns the path
62+
to the currently active log file.
63+
64+
- :issue:`MONGOSH-1995` - Added help output for logging commands.
65+
66+
- Added the following logging configuration options, which you can set directly
67+
in the :ref:`configuration file <configure-settings-global>`, or by calling
68+
the :ref:`config api <configure-settings-api>`.
69+
70+
- :issue:`MONGOSH-1988` - Disable logging by setting ``disableLogging: true``.
71+
72+
- :issue:`MONGOSH-1983`, :issue:`MONGOSH-2012` - Specify a custom path for
73+
:ref:`log files <mdb-shell-logs>` by setting ``logLocation``.
74+
75+
- :issue:`MONGOSH-1986` - Compress log files by setting
76+
``logCompressionEnabled: true``.
77+
78+
- :issue:`MONGOSH-1984` - Limit the number of days to keep log files by
79+
setting ``logRetentionDays`` (default 30).
80+
81+
- :issue:`MONGOSH-1985` - Limit the maximum size of the logs directory by
82+
setting ``logRetentionGB`` (default uncapped).
83+
84+
- :issue:`MONGOSH-1987` - Limit the maximum number of log files by setting
85+
``logMaxFileCount`` (default 100).
86+
87+
88+
Bug Fixes:
89+
90+
- :issue:`MONGOSH-1914` - Fixed an issue where multiple ``mongosh`` processes
91+
could attempt to remove outdated log files at the same time, leading to one
92+
process terminating with ``Error: ENOENT: no such file or directory``.
93+
94+
- :issue:`MONGOSH-2002` - Improved error messaging when attempting to serialize
95+
a cursor.
96+
97+
`Full release notes available on JIRA
98+
<https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=17381&version=42122>`__.
99+
100+
101+
v2.3.9
102+
------
103+
*Released February 5, 2025*
104+
105+
.. important::
106+
This release includes fixes for security issues. Upgrade to ``mongosh``
107+
2.3.9 at your earliest convenience.
108+
109+
- Upgrades Node.js version to 20.18.2. Node 20.18.2 resolves security issues.
110+
For more information, see the `January 21, 2025 Node.js security release \
111+
<https://nodejs.org/en/blog/release/v20.18.2>`__.
112+
113+
- Stricter validation of user input to address
114+
`CVE-2025-1691 <https://nvd.nist.gov/vuln/detail/CVE-2025-1691>`__,
115+
`CVE-2025-1692 <https://nvd.nist.gov/vuln/detail/CVE-2025-1692>`__,
116+
and `CVE-2025-1693 <https://nvd.nist.gov/vuln/detail/CVE-2025-1693>`__.
117+
118+
New features released in this version:
119+
120+
- :issue:`MONGOSH-1989` - Added ability to log custom messages in scripts by
121+
calling ``log.[debug|info|warn|error|fatal]()``
122+
123+
`Full release notes available on JIRA
124+
<https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=17381&version=41759>`__.
125+
126+
127+
v2.3.8
128+
------
129+
130+
*Released January 6, 2025*
131+
132+
Contains internal enhancements and improvements.
133+
134+
`Full release notes available on JIRA
135+
<https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=17381&version=41730>`__.
136+
137+
15138
v2.3.7
16139
------
17140

@@ -34,6 +157,7 @@ Contains internal enhancements and improvements.
34157
`Full release notes available on JIRA
35158
<https://jira.mongodb.org/browse/MONGOSH-1922?jql=project%20%3D%20MONGOSH%20AND%20fixVersion%20%3D%202.3.6>`__.
36159

160+
37161
v2.3.5
38162
------
39163

@@ -48,6 +172,7 @@ Bug Fixes:
48172
`Full release notes available on JIRA
49173
<https://jira.mongodb.org/browse/MONGOSH-1922?jql=project%20%3D%20MONGOSH%20AND%20fixVersion%20%3D%202.3.5>`__.
50174

175+
51176
v2.3.4
52177
------
53178

@@ -491,7 +616,7 @@ v2.0.0
491616
- ``upgradeState``
492617

493618
To obtain version information, see the :ref:`feature compatibility
494-
version (fcv) <view-fcv>`.
619+
version (FCV) <view-fcv>`.
495620

496621
- Removes support for :ref:`Free Monitoring <free-monitoring-mongodb>`
497622
helper functions:

source/connect.txt

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ To connect to a replica set, you can either:
258258
- Explicitly specify the replica set name and members in the connection
259259
string.
260260

261+
.. important::
262+
263+
When a replica set runs in Docker, it might expose only one
264+
MongoDB endpoint. In this case, the replica set is not discoverable, and specifying
265+
``directConnection=false`` can prevent your application from connecting to it.
266+
267+
In a test or development environment, you can connect to the replica set by specifying
268+
``directConnection=true`` in your connection URI. In a production environment, we
269+
recommend configuring the cluster to make each MongoDB instance accessible outside of
270+
the Docker virtual network.
271+
261272
Option 1: DNS Seedlist Format
262273
`````````````````````````````
263274

@@ -345,17 +356,32 @@ To connect to a deployment using TLS, you can either:
345356
Connect to a Specific Database
346357
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347358

348-
To connect to a specific database, specify a database in your
349-
:manual:`connection string URI path </reference/connection-string/>`. If
350-
you do not specify a database in your URI path, you connect to the
351-
``test`` database.
359+
To connect to a specific default database, specify a database in your
360+
:manual:`connection string URI path </reference/connection-string/>`.
361+
If unspecified by the connection string, the default database
362+
is the ``test`` database.
352363

353364
For example, to connect to a database called ``qa`` on localhost, run the
354365
following command:
355366

356367
.. code-block:: sh
357368

358-
mongosh "mongodb://localhost:27017/qa"
369+
mongosh "mongodb://localhost:27017/qa"
370+
371+
You can specify the authentication database in your connection string
372+
using the :urioption:`authSource` connection option. If specified, the
373+
client uses this database to verify your user identity and credentials.
374+
If :urioption:`authSource` is unspecified, it defaults to the default
375+
database specified in the connection string. If both :urioption:`authSource`
376+
and the default database are unspecified,
377+
:urioption:`authSource` defaults to the ``admin`` database.
378+
379+
The following connection string sets the default database to ``myDefaultDB``
380+
and the authentication database to ``admin``:
381+
382+
.. code-block:: bash
383+
384+
mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/myDefaultDB?authSource=admin
359385

360386
Proxy Settings
361387
~~~~~~~~~~~~~~

source/field-level-encryption.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Client-Side Field Level Encryption
55
==================================
66

7+
.. meta::
8+
:description: Configure client-side field level encryption in `mongosh` for MongoDB clusters using various KMS providers like AWS, Azure, GCP, or a local keyfile.
9+
710
.. default-domain:: mongodb
811

912
.. contents:: On this page
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
.. note::
2-
3-
The |mdb-shell| redacts credentials from the :ref:`command history
4-
<mdb-shell-command-history>` and the :ref:`logs
5-
<mdb-shell-view-logs>`.
1+
The |mdb-shell| redacts credentials from the :ref:`command history
2+
<mdb-shell-command-history>` and the :ref:`logs <mdb-shell-view-logs>`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Starting in version 4.4, :binary:`~bin.mongod` / :binary:`~bin.mongos`
2-
logs a warning on connection if the presented x.509 certificate expires
2+
logs a warning on connection if the presented X.509 certificate expires
33
within ``30`` days of the ``mongod/mongos`` host system time.

source/includes/list-table-shell-properties.rst

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- Default
88
- Description
99

10+
* - ``disableLogging``
11+
- boolean
12+
- ``false``
13+
- Specifies whether |mdb-shell| writes log entries.
14+
1015
* - ``displayBatchSize``
1116
- integer
1217
- 20
@@ -52,16 +57,63 @@
5257
- The depth to which objects are printed. Setting ``inspectDepth``
5358
to ``Infinity`` (the javascript object) prints all nested
5459
objects to their full depth.
60+
61+
* - ``logCompressionEnabled``
62+
- boolean
63+
- false
64+
- Specifies whether |mdb-shell| compresses log files. When this
65+
value is ``true``, |mdb-shell| uses gzip to compress logs. See
66+
:ref:`mongosh-log-compression`.
67+
68+
* - ``logLocation``
69+
- string
70+
- Depends on your operating system. See :ref:`mdb-shell-view-logs`.
71+
- Directory where MongoDB Shell writes log files. Specify an
72+
absolute filepath. See :ref:`mongosh-log-location`.
73+
74+
* - ``logMaxFileCount``
75+
- integer or Infinity
76+
- 100
77+
- Maximum number of log files that the |mdb-shell| retains. After
78+
the |mdb-shell| reaches the maximum log file count, it starts
79+
deleting the oldest log files until the count is below the
80+
threshold. See :ref:`mongosh-log-file-count`.
81+
82+
* - ``logRetentionDays``
83+
- integer or Infinity
84+
- 30
85+
- Number of days that |mdb-shell| log files are retained. If this
86+
value is set to ``Infinity``, log files are not deleted based on
87+
age. To prevent log storage from growing too large, always
88+
specify at least one log retention criterion. See
89+
:ref:`mongosh-logs-retention`.
90+
91+
* - ``logRetentionGB``
92+
- float or Infinity
93+
- Unset
94+
- Maximum amount of space in gigabytes used for |mdb-shell| logs.
95+
If the combined size of |mdb-shell| logs exceeds this value, log
96+
files are deleted starting with the oldest logs.
97+
98+
If this value is set to ``Infinity``, log files are not deleted
99+
based on storage size. To prevent log storage from growing too
100+
large, always specify at least one log retention criterion. See
101+
:ref:`mongosh-logs-retention`.
55102

56103
* - ``redactHistory``
57104
- string
58105
- ``remove``
59-
- Controls what information is recorded in the shell history.
60-
Must be one of:
106+
- Controls what information is recorded in the ``mongosh`` command history.
107+
You can access the ``mongosh`` command history via the up and down keys
108+
or Ctrl+R while inside the shell.
109+
110+
Must be one of the following values:
61111

62112
- ``keep``: Retain all history.
63-
- ``remove``: Remove lines which contain sensitive information.
64-
- ``remove-redact``: Redact sensitive information.
113+
- ``remove``: Remove lines that contain sensitive commands from the history.
114+
For example, ``remove`` removes calls to db.auth() or connect().
115+
- ``remove-redact``: Remove lines that contain sensitive commands and redact
116+
specific strings in other history lines, such as file paths, email addresses, and URLs.
65117

66118
* - ``showStackTraces``
67119
- boolean

source/includes/log-file-location.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Starting in |mdb-shell| 2.4.0, you can use the ``log.getPath()``
2+
command to view the current log file location. For example:
3+
4+
.. code-block:: javascript
5+
6+
log.getPath()
7+
8+
Example output:
9+
10+
.. code-block:: javascript
11+
:copyable: false
12+
13+
/Users/jane.doe/.mongodb/mongosh/c2961dbd6b73b052671d9df0_log
14+
15+
The hexadecimal value in the path is the |mdb-shell| log identifier for
16+
the current session.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
You can specify multiple criteria for log retention. For example, you
2+
can specify a maximum duration for log files of 60 days and a maximum
3+
log storage size of 2GB. Logs are deleted when any retention criterion
4+
is met, starting with the oldest logs.

source/includes/platform-limitations.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
- Red Hat Enterprise Linux (RHEL) 7, Amazon Linux 2, SUSE Linux
33
Enterprise Server (SLES) 12, and Ubuntu 18.04 support is deprecated
44
and might be removed in a later ``mongosh`` release.
5-
- If you must use ``Node.js`` 16 with ``mongosh``, install ``Node.js``
6-
and then install ``mongosh`` through ``npm``. The ability to run
7-
``mongosh`` installed with ``npm`` and use ``Node.js`` 16 might be
8-
removed during the lifetime of ``mongosh`` 2.x.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. important::
2+
3+
To prevent log storage from growing too large, always specify at
4+
least one log retention criterion.

source/install/verify-signatures.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Verify Integrity of MongoDB Shell Packages
55
==========================================
66

7+
.. meta::
8+
:description: Verify the integrity of MongoDB Shell packages using digital signatures before installation.
9+
710
.. contents:: On this page
811
:local:
912
:backlinks: none

0 commit comments

Comments
 (0)