Docs Menu
Docs Home
/
MongoDB Manual
/

Release Notes for MongoDB 8.1

On this page

  • Aggregation
  • Stable API
  • General Changes

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.

Starting in MongoDB 8.1, the following aggregation accumulators are available:

Starting in MongoDB 8.1, the following aggregation stages are available:

Starting in MongoDB 8.1, some previously failing $geoNear queries with hidden 2d or 2dsphere indexes will now succeed. In previous releases, some $geoNear queries used to unnecessarily fail with an IndexNotFound error when they included a hidden index due to confusion over which index to use.

Starting in MongoDB 8.1, if the $merge aggregation stage's supporting index is not sparse, the fields specified for the on option can be missing or contain a null value.

Starting in MongoDB 8.1, the renameCollection command and corresponding shell method, db.collection.renameCollection(), are included in Stable API V1.

Starting in MongoDB 8.1, query statistics are collected and reported for count and distinct commands. For details, see count Command Query Shape and distinct Command Query Shape.

Starting in MongoDB 8.1, the durationMillis metric reported in slow query logs accounts for time spent processing authorization and parsing the command. As a result, durationMillis more closely reflects the full command duration.

Starting in MongoDB 8.1 (and 8.0.4 and 7.0.14), the indexStats section of the serverStatus command output tracks indexes in prepareUnique state.

MongoDB 8.1 adds the following server status metrics:

Starting in MongoDB 8.1 (and 8.0.4), you can use setQuerySettings to add comments to query settings. For example, add a comment that indicates why you added query settings.

Starting in MongoDB 8.1, log messages for slow queries contain new metrics if the query execution writes temporary files to disk. These metrics are prefixed by the query execution stage that caused the query to exceed the memory limit. For example, sortSpills indicates the number of times that the sort stage of query execution wrote temporary files to disk.

Metric
Description

<executionPart>Spills

Number of times the corresponding query execution stage wrote temporary files to disk

<executionPart>SpilledBytes

Size, in bytes, of the memory released by writing temporary files to disk

<executionPart>SpilledDataStorageSize

Size, in bytes, of disk space used for temporary files

<executionPart>SpilledRecords

Number of records written to temporary files on disk

For more information on writing temporary files to disk, see allowDiskUse().

Starting in MongoDB 8.1, the following server parameters are available:

Starting in MongoDB 8.1, the following inconsistency types are available:

Starting in MongoDB 8.1, you can access the currently connected client's UUID through connectionStatus.authInfo.UUID.

Starting in MongoDB 8.1, the validate command includes index specifications in the validate.indexDetails output field.

Starting in MongoDB 8.1, you can set your schema's validationAction option to errorAndLog, in which MongoDB rejects any insert or update that violates the validation criteria and logs the error to the mongod log file.

For more information, see Choose How to Handle Invalid Documents.

Starting in MongoDB 8.1 (and 8.0.5), if disk space is running low, MongoDB will fail queries that are spilling to disk.

Back

Release Notes