For AI agents: a documentation index is available at https://www.mongodb.com/zh-cn/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Release Notes for MongoDB 9.0

Warning

MongoDB 9.0 Not Yet Available

MongoDB 9.0 release candidates are not yet available. This version of the manual is for an upcoming release and is currently a work in progress.

Starting in MongoDB 9.0, the changeStreamPreImages.purgingJob.docsDeleted and changeStreamPreImages.purgingJob.bytesDeleted serverStatus metrics may report estimates rather than exact values. These estimates occur when size and count information is not available for the config.system.preimages collection. For details, see changeStreamPreImages.

MongoDB 9.0 also adds a new changeStreamPreImages.markerCreation serverStatus document. This document reports metrics related to the pre-image sampling passes that build the initial truncation information used to remove pre-images. For details, see changeStreamPreImages.

Starting in MongoDB 9.0, the server limits the number of concurrently open multi-document transactions for external clients. When the number of open transactions reaches the limit set by the maxConcurrentMultiDocumentTransactions parameter (default 10000), the server rejects new multi-document transactions and returns a TooManyOpenTransactions error. To learn more, see maxConcurrentMultiDocumentTransactions.

Starting in MongoDB 9.0, MongoDB limits the total amount of memory that a single query operation can use. By default, the limit is 1 gigabyte or 20% of the memory available to the server process, whichever is greater. Operations that exceed the limit fail with ExceededMemoryLimit or QueryExceededMemoryLimitNoDiskUseAllowed. In earlier versions, an operation could use an unbounded amount of memory.

The 100 megabyte per-stage memory limit and the spill-to-disk behavior of individual stages are unchanged. To learn more, see Per-Operation Memory Limit.

Starting in MongoDB 9.0, the server-side JavaScript functions ($accumulator, $function, and $where) are no longer deprecated. MongoDB 9.0 re-enables these functions using a WebAssembly (WASM)-based JavaScript engine, which improves security through stronger sandboxing and isolation than prior versions. These functions were previously deprecated in MongoDB 8.0. To learn more, see Server-side JavaScript.

MongoDB 9.0 adds the following serverStatus metrics:

MongoDB 9.0 adds the following checkMetadataConsistency inconsistency types:

MongoDB 9.0 removes the ShardCatalogCacheCollectionMetadataMismatch inconsistency type.

Starting in MongoDB 9.0, when you run a find, aggregate, or listIndexes command on a time series collection, the cursor.ns field in the response returns the user-facing namespace you originally targeted. In previous versions, the server could return the internal namespace.

Starting in MongoDB 9.0, change streams on sharded clusters open cursors only on the shards that hold relevant data and adjust targeting automatically as the cluster topology changes. MongoDB 9.0 also adds the ignoreRemovedShards parameter to the $changeStream aggregation stage. When set to true, a change stream continues and skips events from a shard that was removed from the cluster instead of returning an error. For details, see $changeStream.

MongoDB 9.0 deprecates the net.wireObjectCheck configuration option and its corresponding --objcheck and --noobjcheckand CLI arguments. Starting in 9.0, MongoDB validates all BSON objects that the server ingests by default. If the server receives invalid BSON data, MongoDB returns an error.

MongoDB 9.0 introduces a new schema validation level of constraint. With the constraint validation level, MongoDB applies the validation rules to all document inserts and updates, and guarantees that every document in the collection satisfies the rules. For details, see Specify constraint Validation.

Starting in 9.0, MongoDB stores time series collections as a single namespace that contains time series data compressed into buckets. Time series collections are no longer writable non-materialized views.

Starting in MongoDB 9.0, you can rename time series collections with renameCollection.

MongoDB 9.0 updates the $queryStats output to streamline metrics organization. This update includes the following new output fields:

Field
Description

metrics.cursor

A document that contains metrics relevant to the cursor and batching protocol

metrics.queryExec

A document that contains metrics relevant to query execution

metrics.queryPlanner

A document that contains metrics relevant to the query planner

metrics.writes

A document that contains metrics relevant to operation writes

For more information on the new output structure, see $queryStats Output.

Starting in 9.0, MongoDB collections and reports query statistics for update, insert, and delete commands. For details, see update Command Query Shape, insert Command Query Shape, and delete Command Query Shape.

Starting in MongoDB 9.0, a dotted path that does not resolve to a non-null value evaluates as null. The new behavior applies when a field in the path holds an empty array or an array of scalar values. Comparisons to null that use the $eq, $ne, $in, $nin, $gte, and $lte operators reflect the new semantics. Equality matching in the $lookup stage also reflects the new semantics. Queries that compare a dotted path to null can return different results after you upgrade. For details, see Compatibility Changes in MongoDB 9.0.

MongoDB 9.0 adds the useInternalAuthzForX509 parameter. When set to true, clients that authenticate using MONGODB-X509 use internal authorization, even when LDAP authorization is configured. For details, see useInternalAuthzForX509.

MongoDB 9.0 adds the authenticatedMechanism field to the usersInfo command. This optional string field specifies an authentication mechanism to determine which authorization backend usersInfo queries when looking up user authorization information. For details, see usersInfo.

Starting in MongoDB 9.0, mongocryptd is deprecated. Use the Automatic Encryption Shared Library instead. The Automatic Encryption Shared Library replaces mongocryptd and does not require you to start a separate process. For details, see Install and Configure a CSFLE Query Analysis Component and Install and Configure a Query Analysis Component.

MongoDB 9.0 adds the directRemote field to audit messages in the mongo schema and the direct_endpoint field to audit messages in the OCSF schema. These fields record the literal TCP peer for a session, independent of any client address that a PROXY protocol header asserts. For details, see mongo Schema Audit Messages and OCSF Schema Audit Messages.

Starting in MongoDB 9.0, the following metrics are available when using the replSetGetStatus command during a logical initial sync:

Each document in initialSyncAttempts also reports the phase, nodeUptimeSecs, and phaseDurations for that attempt. For details, see replSetGetStatus.initialSyncStatus.initialSyncAttempts.

Starting in MongoDB 9.0, key-extraction failures on 2dsphere indexes produce structured diagnostics that make unindexable documents easier to identify:

  • Geo key-extraction failures now throw the named error codes 510 (GeoKeyExtractionFailed) and 511 (GeoKeyExtractionFailedTimeseries), which replace the previous unnamed assertion codes.

  • Failed geo inserts and index builds now include a writeErrors[].errInfo document that contains the failingPath, underlyingCode, underlyingReason, and failingElement fields. Existing field names are unchanged, but the error reason string is now bounded to 256 characters.

  • The validate.errors output for geo key-extraction failures now emits a bounded, self-contained message and writes full per-document detail to the mongod log. Identical failures on the same index and path are deduplicated into a single message, so to map a failure back to specific documents, consult the log instead of the validate output. Full per-document detail is logged only when log redaction is disabled. For details, see validate.