Compatibility Changes in MongoDB 8.1
Warning
MongoDB 8.1 Not Yet Available
MongoDB 8.1 release candidates are not yet available. This version of the manual is for an upcoming release and is currently a work in progress.
Important
MongoDB 8.1 is a rapid release and is only supported for MongoDB Atlas. MongoDB 8.1 is not supported for use on-premises. For more information, see MongoDB Versioning.
To install the latest MongoDB version supported for on-premises use, MongoDB 8.0, see the MongoDB 8.0 installation instructions.
Backward-Incompatible Features
Aggregation
$densify Validation Changes
Starting in MongoDB 8.1, the $densify
stage errors if
field
shares its prefix with any field in the partitionByFields
array. For example, the following combinations of field
and
partitionByFields
result in an error:
field: "timestamp"
,partitionByFields: ["timestamp"]
field: "timestamp"
,partitionByFields: ["timestamp.hours"]
field: "timestamp.hours"
,partitionByFields: ["timestamp"]
Validation Action for Handling Invalid Documents
If you use an errorAndLog
validation action on a collection, MongoDB
cannot downgrade until you drop the collection, or if you change the validation
action for the collection to one supported in older versions. To change the validation
action on a collection, use the collMod
command.
General Changes
Hedged Reads Removed
Starting in MongoDB 8.1, hedged reads are removed. If you specify hedged read options in a query, MongoDB executes the query but ignores the hedging options and logs a warning.
The following server parameters related to hedged reads no longer have an effect:
maxTimeMSForHedgedReads
opportunisticSecondaryTargeting
readHedgingMode
The serverStatus
command no longer returns the
hedgingMetrics
object.
Driver Incompatibility
Any application that runs the buildInfo
command before
authenticating is incompatible with MongoDB 8.1. The following
driver versions are incompatible with MongoDB 8.1 because of this
change:
JVM drivers v3.x and earlier (includes Java Sync, Java Reactive Streams, Kotlin Coroutine, Kotlin Sync, and Scala drivers)
.NET/C# driver v2.14.1 and earlier
Maximum Incoming Connections
Starting in MongoDB 8.1, the maximum number of incoming connections that you can
set with the net.maxIncomingConnections
configuration file option
on Linux systems is the value of
(RLIMIT_NOFILE / 2)
* 0.8. If you specify a larger value, MongoDB uses the default value.
Subtype Conversion
Starting in MongoDB 8.1, $convert
returns an error when attempting
to convert between different binData subtypes. In MongoDB 8.0,
$convert
returns the original value and original subtype: no
conversion is performed. MongoDB versions before 8.0 don't have binData
conversion.
Interpolating Identical Values in Different Partitions
Starting in MongoDB 8.1, $fill
can use the linear
method to
interpolate if there are identical values in different partitions.
Earlier MongoDB versions return an error stating the sort field cannot have repeated values.
For details, see Interpolate Identical Values in Different Partitions.
Deprecations
Deprecated | Description |
---|---|
| Starting in MongoDB 8.1, the old
For details, see
|