Release Notes for MongoDB 6.0
On this page
- Patch Releases
- Aggregation
- Change Streams
- Cluster Administration
- Clustered Collections
- Indexes
- Installation
- Replica Sets
- Security
- Sharding
- Slot-Based Query Execution Engine
- Stable API
- Time Series Collections
- General Improvements
- Changes Affecting Compatibility
- Upgrade Procedures
- Downgrade Consideration
- Download
- Known Issues
- Report an Issue
This page describes changes and new features introduced in MongoDB 6.0.
MongoDB 6.0 is a Major Release, which means that it is supported for both MongoDB Atlas and on-premises deployments. MongoDB 6.0 includes changes introduced in MongoDB Rapid Releases 5.1, 5.2, and 5.3. This page describes changes introduced in those Rapid Releases and MongoDB 6.0.
To learn more about the differences between Major and Rapid releases, see MongoDB Versioning.
Warning
Past Release Limitations
Some past releases have critical issues. These releases are not recommended for production use. Use the latest available patch release version instead.
Issue | Affected Versions |
---|---|
6.0.0 | |
6.0.0 - 6.0.11 (Time Series collections sharded by metaField embedded
objects) | |
6.0.0 - 6.0.4 (ARM64 or POWER system architectures) | |
6.0.0 - 6.0.5 (Incremental backups on Ops Manager or Cloud
Manager clusters) |
Patch Releases
6.0.15 - Upcoming
SERVER-72703 Downgrade $out's db lock to MODE_IX
SERVER-78556 Return default of internalInsertMaxBatchSize to 64
SERVER-80363 server default writeConcern is not honored when wtimeout is set
SERVER-83602 $or -> $in MatchExpression rewrite should not generate $or directly nested in another $or
WT-11062 Safe free the ref addr to allow concurrent access
6.0.14 - Feb 28, 2024
Important
Fix for MongoDB Server may allow successful untrusted connection
Due to CVE-2024-1351, in MongoDB 6.0 prior to 6.0.14, under certain
configurations of --tlsCAFile
and
CAFile
, MongoDB Server may skip peer certificate
validation which may result in untrusted connections to succeed.
This may effectively reduce the security guarantees provided by TLS and open connections that should have been closed due to failing certificate validation. This issue affects the following MongoDB Server versions:
7.0.0 - 7.0.5
6.0.0 - 6.0.13
5.0.0 - 5.0.24
4.4.0 - 4.4.28
CVSS Score: 8.8
CWE: CWE-295: Improper Certificate Validation
SERVER-82353 Multi-document transactions can miss documents when movePrimary runs concurrently
SERVER-83119 Secondary replica crashes on clustered collection if notablescan is enabled
SERVER-83145 Shared buffer fragment incorrectly tracks memory usage in freeUnused()
SERVER-83564 Make sure the process field is indexed in config.locks
WT-12077 Incorrect hardware checksum calculation on zSeries for buffers on stack
6.0.13 - Jan 18, 2024
SERVER-33494 WT SizeStorer never deletes old entries
SERVER-50792 Return more useful errors when a shard key index can't be found for shardCollection/refineCollectionShardKey
SERVER-70155 Add duration of how long an oplog slot is kept open to mongod "Slow query" log lines
SERVER-77506 Sharded multi-document transactions can mismatch data and ShardVersion
SERVER-83091 $or query can trigger an infinite loop during plan enumeration
6.0.12 - Nov 27, 2023
SERVER-69244 $merge fails when session default read concern has been set to "majority"
SERVER-81295 Cannot resume V2 changeStream pipelines with V1 resume tokens
SERVER-81966 Avoid modification of previous ChunkMap instances during refresh
WT-7929 Investigate a solution to avoid FTDC stalls during checkpoint
WT-11564 Fix RTS to read the newest transaction value only when it exists in the checkpoint
6.0.11 - Oct 11, 2023
SERVER-58534 Collect fCV in FTDC
SERVER-69244 $merge fails when session default read concern has been set to "majority"
SERVER-71520 Dump all thread stacks on RSTL acquisition timeout
SERVER-79498 Backport $vectorSearch to 6.0
SERVER-80021 Make $convert round-trip correctly between double and string
6.0.10 - Sep 14, 2023
SERVER-71627 Refreshed cached collection route info severely blocks all client request when a cluster contains 1 million chunks
SERVER-73394 Remove misleading operationsBlockedByRefresh metrics
SERVER-77183 $project followed by $group sometimes gives incorrect results
SERVER-79771 Make resharding operations resilient to networkInterfaceExceededTimeLimit All Jira issues closed in 6.0.10
6.0.9 - Aug 14, 2023
SERVER-60466 Support drivers gossiping signed $clusterTimes to replica set --shardsvrs before addShard runs
SERVER-74954 Incorrect result when contained $or rewrites $elemMatch extra condition
SERVER-79136 Incorrect query result of $match + $group on metaField over time-series
WT-10759 Do not retry to force evict history store pages during reconciliation
WT-11064 Skip globally visible tombstones as part of update obsolete check
6.0.8 - Jul 13, 2023
SERVER-61127 Multi-writes may exhaust the number of retry attempts in the presence of ongoing chunk migrations
SERVER-77005 Leave LDAP users logged-in during LDAP downtime
SERVER-78126 For specific kinds of input, mongo::Value() always hashes to the same result on big-endian platforms
6.0.7 - Jun 28, 2023
SERVER-71985 Automatically retry time series insert on DuplicateKey error
SERVER-73007 CURL_OPT_SEEKFUNCTION not set for multi-pass authentication
SERVER-74551 WriteConflictException unnecessarily logged as warning during findAndModify after upgrade to mongo 5.0
SERVER-77018 Deadlock between dbStats and 2 index builds
WT-10449 Do not save update chain when there are no updates to be written to the history store
WT-11031 Fix RTS to skip tables with no time window information in the checkpoint
6.0.6 - May 12, 2023
SERVER-51835 Mongos readPreferenceTags are not working as expected
SERVER-67105 $in queries do not use clustered index
SERVER-72774 A node in quiesce mode can win election
SERVER-74930 $avg is returning the sum instead of the average in aggregate $group
SERVER-75205 Deadlock between stepdown and restoring locks after yielding when all read tickets exhausted
6.0.5 - Mar 13, 2023
Issues Fixed:
SERVER-61909 Hang inserting or deleting document with large number of index entries
SERVER-66469 Filtering timeseries with date-field does not include results from before 1970
SERVER-68122 Investigate replicating the collection WiredTiger config string during initial sync
SERVER-70395 Slot-Based Engine too aggressively uses disk for $group and is slow
SERVER-73232 Change the default log-verbosity for
_killOperations
6.0.4 - Jan 26, 2023
Issues Fixed:
SERVER-72416 The find and findAndModify projection code does not honor the collection level collation
SERVER-71759
dataSize
command doesn't yieldSERVER-70237 Chunks merge commit must not create a BSON object too large
SERVER-72222
mapReduce
with single reduce optimization fails when merging results in sharded clusterWT-9268 Delay deletion of the history store record to reconciliation
6.0.3 - Nov 21, 2022
Issues fixed:
SERVER-66289 $out incorrectly throws BSONObj size error on v5.0.8
SERVER-68139 Resharding command fails if the projection sort is bigger than 100MB
SERVER-68371 Enabling CSFLE in your MongoClient causes Atlas Search to fail
SERVER-68115 Bug fix for "elemMatchRootLength > 0" invariant trigger
SERVER-68394 Ensure we do not yield strong locks upon startup recovery when _id index is missing
6.0.2 - Sep 28, 2022
Issues fixed:
SERVER-68925 Reintroduce check table logging settings at startup (revert SERVER-43664)
SERVER-68628 Retrying a failed resharding operation after a primary failover can lead to server crash or lost writes
SERVER-63852 getThreadName() should not crash
SERVER-65317 mongod removes connection from connection pool after running simple $search query
SERVER-63843 Don't allow recursive doLog in synchronous signal handlers
WT-9870 Fix updating pinned timestamp whenever oldest timestamp is updated during recovery
6.0.1 - Aug 19, 2022
Issues fixed:
SERVER-68511 MovePrimary update of
config.databases
entry must use dotted fields notationSERVER-68062 Multi-stage aggregations that use $geoNear may violate constraints
SERVER-66072 $match sampling and $group aggregation strange behavior
SERVER-68130 AutoSplitVector could generate response bigger than BSONObjMaxUserSize
SERVER-68209 Remove uassert that prevents
config.image_collection
entry from being invalidated
6.0.0 - Jul 19, 2022
The rest of this page describes changes and new features introduced in MongoDB 6.0.
Aggregation
New Aggregation Stages
MongoDB 6.0 introduces the following aggregation stages:
Stage | Description |
---|---|
Creates new documents in a sequence of documents where values in
a specified field are missing. | |
Returns literal documents from input expressions. | |
Populates | |
New in version 6.0.3: Provides size and data distribution information on sharded collections. |
New Aggregation Operators
MongoDB 6.0 introduces the following aggregation operators:
Operator | Description |
---|---|
Returns the bottom element within a group according to the specified
sort order. | |
Returns an aggregation of the bottom n elements within a group,
according to the specified sort order. | |
Returns an aggregation of the first n elements within a group.
Distinct from the $firstN array operator. | |
Returns a specified number of elements from the beginning of an
array.
Distinct from the $firstN accumulator. | |
Returns an aggregation of the last n elements within a group.
Distinct from the $lastN array operator. | |
Returns a specified number of elements from the end of an
array.
Distinct from the $lastN accumulator. | |
Fills | |
Last observation carried forward. Sets values for | |
Returns an aggregation of the n maximum valued elements
within a group.
Distinct from the $maxN array operator. | |
Returns the n largest values in an array.
Distinct from the $maxN accumulator. | |
Returns an aggregation of the n minimum valued elements
within a group.
Distinct from the $minN array operator. | |
Returns the n smallest values in an array.
Distinct from the $minN accumulator. | |
Sorts an array based on its elements. | |
Returns the top element within a group according to the specified
sort order.
Distinct from the command top . | |
Returns an aggregation of the top n elements within a group,
according to the specified sort order. | |
$lookup
and $graphLookup
with Sharded Collections
Starting in MongoDB 5.1,
the $lookup
and $graphLookup
aggregation stages
support sharded collections in the from
parameter.
In previous versions of MongoDB, $lookup
and $graphLookup
only allowed for unsharded from
collections.
You cannot use the $graphLookup
stage within a transaction while
targeting a sharded collection.
Change Streams
Optimized Change Streams
Starting in MongoDB 5.1, change streams are optimized, providing more efficient resource utilization and faster execution of some aggregation pipeline stages.
wallTime
Change Stream Output Field
Starting in MongoDB 6.0, the change stream output has a new wallTime
field that contains the
server date and time of the database operation.
Change Streams with Document Pre- and Post-Images
Starting in MongoDB 6.0, you can use change streams to output the version of a document before and after changes (the document pre- and post-images). For examples, see Change Streams with Document Pre- and Post-Images.
Change Stream Expanded Events
Starting in MongoDB 6.0, change streams can show additional change events for DDL operations, like creating indexes and dropping collections.
For more information, see Expanded Events.
Filters
Starting in MongoDB 6.0, whenever possible, match filters are applied to change streams earlier than in prior releases. This improves performance. However, when a filter is narrowly defined, an earlier match may cause an operation that succeeds in prior versions to fail in 6.0.
Cluster Administration
Cluster Server Parameters
Starting in MongoDB 6.0, you can use Cluster Parameters to modify
and retrieve configuration options for all nodes in a replica set or sharded
cluster. You can use setClusterParameter
to modify cluster-wide
options and getClusterParameter
to retrieve the value of a cluster
parameter.
Connection Pool Parameters
Starting in MongoDB 6.0, you can use
ShardingTaskExecutorPoolMinSizeForConfigServers
and
ShardingTaskExecutorPoolMaxSizeForConfigServers
to set the
minimum and maximum sharding TaskExecutor connection pool size for
configuration servers.
changeStreamOptions
Cluster Parameter
Starting in MongoDB 6.0, you can use changeStreamOptions
to control
the retention policy of change stream pre- and post-images.
internalSessionsReapThreshold
Parameter
Starting in MongoDB 6.0, you can use the new
internalSessionsReapThreshold
parameter to set the session
limit for internal session metadata deletion.
Multiple Arbiters Unsupported
Starting in MongoDB 5.3, support for multiple arbiters in a replica set is
disabled by default. To enable support for multiple arbiters, start each
node with the allowMultipleArbiters
parameter.
Clustered Collections
Starting in MongoDB 5.3, you can create clustered collections.
Clustered collections store indexed documents in the same WiredTiger file as the index specification. Storing the collection's documents and index in the same file provides benefits for storage and performance compared to regular indexes.
Clustered collections are created with a clustered index. The clustered index specifies the order in which documents are stored.
To create a clustered collection, see Examples.
To learn about the benefits compared to a normal collection, see Clustered Collections.
Indexes
Starting in MongoDB 5.1, you can use the collMod
database
command to add the expireAfterSeconds
option to an existing
single-field non-TTL index.
Starting in MongoDB 6.0, you can use the prepareUnique
and
unique
options for the collMod
command to convert an
existing standard index to a unique index.
Partial Indexes
Starting in MongoDB 6.0, you can use the operators $in
and $or
to create partial indexes. The partialFilterExpression
maximum depth is also expanded from 2 to 4. You can now use the operators $and
and $or
at non-top-levels.
Installation
SELinux Policies
Starting in MongoDB 5.1, there is a new SE Linux Policy for:
MongoDB Enterprise Server
MongoDB Community Edition Server
running on Red Hat Linux. The SELinux policy is for use with default
installations using rpm
installer packages.
Replica Sets
Multiple Arbiters Unsupported
Starting in MongoDB 5.3, support for multiple arbiters in a replica set is
disabled by default. To enable support for multiple arbiters, start each
node with the allowMultipleArbiters
parameter.
initialSyncMethod
Parameter
Starting in MongoDB 5.2, the initialSyncMethod
determines
whether initial sync is a
logical initial sync or a
file copy based initial sync.
initialSyncMethod
is only available in MongoDB Enterprise
Server.
Specify Secondary Oplog Batch Delay
Starting in MongoDB 6.0, you can use the
oplogBatchDelayMillis
server parameter to specify a delay
for writes of oplog batches on secondaries. Adding a short oplog batch
delay can reduce IOPS on
secondaries, but adds latency for writes with write concern
"majority"
.
For more information, see oplogBatchDelayMillis
.
Security
Audit Log Encryption
Starting in MongoDB 6.0 Enterprise, you can encrypt the MongoDB audit log.
To configure the audit log, see Audit Log.
Sharding
Balancing Policy Changes
Starting in MongoDB 6.0.3, data in sharded clusters is distributed based on data size rather than number of chunks. Be aware of the following significant changes in sharded cluster data distribution behavior:
The balancer distributes ranges of data rather than chunks. The balancing policy looks for evenness of data distribution rather than chunk distribution.
Chunks are not subject to auto-splitting. Instead, chunks are split only when moved across shards.
A chunk is now referred to as a range.
moveRange
has replacedmoveChunk
.
Default Chunk Size Increased from 64 MB to 128 MB
Starting in MongoDB 5.2, the default chunk size is 128 megabytes. In earlier versions of MongoDB, the default chunk size is 64 megabytes.
enableSharding
No Longer Required
Starting in MongoDB 6.0, the enableSharding
command is
no longer required to shard a collection.
Monitor Defragmentation Status
Starting in MongoDB 5.3, the balancerCollectionStatus
command returns detailed information when run on a namespace going
through chunk defragmentation. The output includes the current phase of
the defragmentation and how many chunks are left to process.
To see example output, see Ongoing Defragmentation Process.
Slot-Based Query Execution Engine
Starting in MongoDB 5.1, MongoDB uses a new query execution engine for eligible queries, called the slot-based query execution engine. If the slot-based query execution engine is used, new fields are included in the query explain plan output.
The new query execution engine is used if possible.
If the new query execution engine is used, new fields are included in the query explain plan output.
Slot-Based Query Execution Engine Can Execute $group
and $lookup
Stages
Starting in version 6.0, MongoDB uses the slot-based query execution engine to execute eligible
$group
and $lookup
stages when certain
conditions are met.
For more information, see Slot-Based Query Execution Engine Pipeline Optimizations.
Set Slot-Based Query Execution Engine Plan Cache Size
You can set the size of the plan cache for the new query engine with the
planCacheSize
parameter.
Increasing the plan cache size adds more cached query shapes for the query planner. This can improve query performance, but increases memory usage.
Stable API
The following sections describe additions to the Stable API introduced in MongoDB 6.0.
To see the full list of database commands available in the Stable API, see Stable API Changelog.
Database Commands
Starting in MongoDB 6.0, the following database commands are supported in the Stable API:
Command | Description | Stable API Version |
---|---|---|
Counts the number of documents in a collection or a view. (Also
available in the Stable API for 5.0-series deployments starting
in MongoDB 5.0.9.) | V1 |
Aggregation Stages and Operators
Starting in MongoDB 6.0, the following aggregation stages and operators are supported in the Stable API:
Stage or Operator | Description | Stable API Version |
---|---|---|
Returns the bottom element within a group, according to the specified
sort order. | V1 | |
Returns an aggregation of the bottom n elements within a group,
according to the specified sort order. | V1 | |
Increments a Date() object by a
specified number of time units. | V1 | |
Returns the difference between two dates. | V1 | |
Decrements a Date() object by a
specified number of time units. | V1 | |
Truncates a date. | V1 | |
Creates new documents in a sequence of documents where certain values in a field are missing. | V1 | |
$firstN (aggregation accumulator) | Returns an aggregation of the first n elements within a group. | V1 |
$firstN (array operator) | Returns a specified number of elements from the beginning of an
array. | V1 |
Returns the value of a specified field from a document. | V1 | |
$lastN (aggregation accumulator) | Returns an aggregation of the last n elements within a group. | V1 |
$lastN (array operator) | Returns a specified number of elements from the end of an
array. | V1 |
Last observation carried forward. Sets values for | V1 | |
$maxN (aggregation accumulator) | Returns an aggregation of the maximum value n elements within
a group. | V1 |
$maxN (array operator) | Returns the n largest values in an array. | V1 |
$minN (aggregation accumulator) | Returns an aggregation of the minimum value n elements within
a group. | V1 |
$minN (array operator) | Returns the n smallest values in an array. | V1 |
Adds, updates, or removes a specified field in a document. | V1 | |
Performs operations on a specified span of documents in a
collection, known as a window, and returns the results based on
the chosen window operator. | V1 | |
Sorts an array based on its elements. | V1 | |
Returns the top element within a group according to the specified
sort order. | V1 | |
Returns an aggregation of the top n elements within a group,
according to the specified sort order. | V1 | |
V1 | ||
V1 |
Window Operators
Starting in MongoDB 6.0, the following window operators are supported in the Stable API:
Window Operator | Description | Stable API Version |
---|---|---|
Returns an array of all unique values that results from
applying an expression to
each document. | V1 | |
Returns the average for the specified expression. Ignores non-numeric values. | V1 | |
Returns the number of documents in the group or window. | V1 | |
Returns the population covariance of two numeric
expressions. | V1 | |
Returns the sample covariance of two numeric
expressions. | V1 | |
Returns the document position (known as the rank) relative to
other documents in the $setWindowFields stage
partition. There are no
gaps in the ranks. Ties receive the same rank. | V1 | |
Returns the average rate of change within the specified
window. | V1 | |
Returns the position of a document (known as the document
number) in the $setWindowFields stage
partition. Ties result in
different adjacent document numbers. | V1 | |
Returns the exponential moving average for the numeric
expression. | V1 | |
Returns the value that results from applying an
expression to the first
document in a group or window. | V1 | |
Returns the approximation of the area under a curve. | V1 | |
Returns the value that results from applying an
expression to the last
document in a group or window. | V1 | |
Last observation carried forward. Sets values for | V1 | |
Returns the maximum value that results from applying an
expression to each document. | V1 | |
Returns the minimum value that results from applying an
expression to each document. | V1 | |
Returns an array of values that result from applying an
expression to each document. | V1 | |
Returns the document position (known as the rank) relative to
other documents in the $setWindowFields stage
partition. | V1 | |
Returns the value from an expression applied to a document in a
specified position relative to the current document in the
$setWindowFields stage partition. | V1 | |
Returns the population standard deviation that results from
applying a numeric expression
to each document. | V1 | |
Returns the sample standard deviation that results from
applying a numeric expression
to each document. | V1 | |
Returns the sum that results from applying a numeric
expression to each document. | V1 |
Time Series Collections
The following sections describe improvements and new features for time series collections.
Sharded Time Series Collections
MongoDB 5.1 provides support for sharded time series collections.
See:
Sharded Time Series Granularity
Starting in MongoDB 6.0, you can modify the granularity of sharded time series collections.
Updates and Deletes
Starting in MongoDB 5.1, time series collections support update and delete operations with limitations.
Time Series Column Compression
Starting in MongoDB 5.2, time series collections use column compression. Column compression adds a number of innovations that work together to significantly improve practical compression, reduce your data's overall storage on disk, and improve read performance.
Starting in MongoDB 6.0, arrays are also compressed as part of the time series column compression.
Support for $geoNear
Starting in MongoDB 5.3, you can use the $geoNear
pipeline
operator on any field in a time series collection.
Additional Secondary Index Types
You can add additional secondary index types to time series collections, including 2dsphere and 2d indexes.
For all additional indexes and other improvements, see Time Series Secondary Indexes in MongoDB 6.0 and Later.
Sort Operations Use Secondary Indexes
Sort operations on time series collections can use indexes to improve performance. For more information and an example, see Use Secondary Indexes to Improve Sort Performance.
General Improvements
OpenSSL3 FIPS Support
Starting in MongoDB 6.0.7, FIPS mode supports OpenSSL3 for the following operating systems:
Ubuntu 22.04
RHEL 9
Amazon Linux 2023
Capped Collections Improvements
Starting in MongoDB 6.0, you can change a
capped collection's maximum size, either in
bytes or in number of documents, using the collMod
command. See
Resize a Capped Collection for more details.
numOrphanDocs
Field Added to collStats Command
Starting in MongoDB 6.0, the collStats output
includes the collStats.numOrphanDocs
field that shows the number of
orphaned documents in the collection.
Exclude Embedded Fields in serverStatus
Output
Starting in MongoDB 6.0 (and 5.0.9), you can exclude embedded fields
from the serverStatus
output.
Connections
Starting in MongoDB 6.0, the Mongo()
connection object has the following new methods:
Mongo.getWriteConcern()
returns the write concernMongo.setWriteConcern()
sets the write concern
Support for Diagnostic Backtrace Generation in arm64
Starting in MongoDB 6.0 (and 5.0.10), diagnostic backtrace
generation in arm64
is supported.
Configure Refresh Interval for Cached LDAP User Information
Starting in MongoDB 5.2, you can use the following new server parameters to configure the refresh interval for cached LDAP user information:
Starting in MongoDB 5.2, the update interval for cached user information
retrieved from an LDAP server depends on
ldapShouldRefreshUserCacheEntries
:
If true, use
ldapUserCacheRefreshInterval
.If false, use
ldapUserCacheInvalidationInterval
.
Changes Affecting Compatibility
Some changes can affect compatibility and may require user actions. For a detailed list of compatibility changes, see Compatibility Changes in MongoDB 6.0.
Upgrade Procedures
Important
Feature Compatibility Version
To upgrade to MongoDB 6.0 from a 5.0 deployment, the 5.0 deployment
must have featureCompatibilityVersion
set to 5.0
. To check
the version:
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
To upgrade to MongoDB 6.0, refer to the upgrade instructions specific to your MongoDB deployment:
If you need guidance on upgrading to 6.0, MongoDB professional services offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application. To learn more, see MongoDB Consulting.
Downgrade Consideration
MongoDB only supports single-version downgrades. You cannot downgrade to a release that is multiple versions behind your current release.
For example, you may downgrade a 6.0-series to a 5.0-series deployment. However, further downgrading that 5.0-series deployment to a 4.4-series deployment is not supported.
Download
To download MongoDB 6.0, go to the MongoDB Download Center.
Known Issues
This section describes known issues in MongoDB 6.0 and their resolution status.
In Version | Issue | Status |
---|---|---|
6.0.0 | SERVER-68062: Multi-stage aggregations that use
$geoNear may violate constraints. | Resolved in 6.0.1. |
Report an Issue
To report an issue, see the MongoDB GitHub repository for instructions on how to file a JIRA ticket for the MongoDB server or one of the related projects.