Database Manual / Release Notes / 8.2 (Stable Release)

Compatibility Changes in MongoDB 8.2MongoDB 8.2的兼容性变化

Important

MongoDB 8.3 is the latest minor release. Starting with MongoDB 8.2, minor releases are available for on-premises deployments (Community and EA) for specific use cases. For more information, see MongoDB Versioning.MongoDB 8.3是最新的次要版本。从MongoDB 8.2开始,次要版本可用于特定用例的本地部署(社区和EA)。有关更多信息,请参阅MongoDB版本控制

To install the latest MongoDB version supported for on-premises use, see the installation instructions.要安装支持本地使用的最新MongoDB版本,请参阅安装说明

General Changes一般变更

$$CLUSTER_TIME Errors on Standalone Deployments独立部署时出现$$CLUSTER_TIME错误

Starting in MongoDB 8.2, if you try to use the CLUSTER_TIME variable in a standalone deployment, the server returns an error.从MongoDB 8.2开始,如果您尝试在独立部署中使用CLUSTER_TIME变量,服务器将返回错误。

$rankFusion on Views视图上的$rankFusion

Starting in MongoDB 8.2, $rankFusion can now run on views. For more information, see $rankFusion.从MongoDB 8.2开始,$rankFusion现在可以在视图上运行。有关更多信息,请参阅$rankFusion

orphanCleanupDelaySecs Change变化

Starting in MongoDB 8.2, the default value of orphanCleanupDelaySecs is 3600 (previously 900).从MongoDB 8.2开始,orphanCleanupDelaySecs的默认值是3600(以前是900)。

Remaining Resharding Time Threshold Change剩余重新硬化时间阈值更改

Starting in MongoDB 8.2 (also available in 8.1.2 and 8.0.13), resharding enters the critical section when the estimated time to complete the remaining work is 500 ms or less.从MongoDB 8.2(也在8.1.2和8.0.13中提供)开始,当完成剩余工作的估计时间为500毫秒或更短时,重新标记进入关键部分。

$cpuNanos Change变化

Starting in MongoDB 8.2, cpuNanos is located in the $queryStats aggregation stage metrics and includes additional metrics related to CPU usage for query operations. The cpuNanos metric is only available on Linux systems.从MongoDB 8.2开始,cpuNanos位于$queryStats聚合阶段指标中,包括与查询操作的CPU使用率相关的其他指标。cpuNanos指标仅在Linux系统上可用。

In earlier versions, cpuNanos was located in operationMetrics.在早期版本中,cpuNanos位于operationMetrics

Removed Parameters已删除参数

MongoDB 8.2 removes the catalogCacheIndexMaxEntries parameter.MongoDB 8.2删除了catalogCacheIndexMaxEntries参数。

Compatibility Changes Introduced in MongoDB 8.1MongoDB 8.1中引入的兼容性更改

MongoDB 8.2 also includes changes introduced in MongoDB 8.1. This section describes compatibility changes that were introduced in MongoDB 8.1.MongoDB 8.2还包括MongoDB 8.1中引入的更改。本节介绍MongoDB 8.1中引入的兼容性更改。

$densify Validation Changes验证更改

Starting in MongoDB 8.1, the $densify stage errors if field shares its prefix with any field in the partitionByFields array. 从MongoDB 8.1开始,如果fieldpartitionByFields数组中的任何字段共享前缀,则$densify阶段会出错。For example, the following combinations of field and partitionByFields result in an error:例如,以下fieldpartitionByFields的组合会导致错误:

  • field: "timestamp", partitionByFields: ["timestamp"]
  • field: "timestamp", partitionByFields: ["timestamp.hours"]
  • field: "timestamp.hours", partitionByFields: ["timestamp"]

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:任何在身份验证之前运行buildInfo命令的应用程序都与MongoDB 8.1不兼容。由于此更改,以下驱动程序版本与MongoDB 8.1不兼容:

  • JVM drivers v3.x and earlier (includes Java Sync, Java Reactive Streams, Kotlin Coroutine, Kotlin Sync, and Scala drivers)JVM驱动程序v3x及更早版本(包括Java同步、Java反应流、Kotlin协程、Kotlin同步和Scala驱动程序)
  • .NET/C# driver v2.14.1 and earlier驱动程序v2.14.1及更早版本

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.从MongoDB 8.1开始,对冲读取被删除。如果在查询中指定了对冲读取选项,MongoDB将执行查询,但忽略对冲选项并记录警告。

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.serverStatus命令不再返回hedgingMetrics对象。

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.从MongoDB 8.1开始,如果不同分区中有相同的值,$fill可以使用linear(线性)方法进行插值。

Earlier MongoDB versions return an error stating the sort field cannot have repeated values.早期的MongoDB版本返回一个错误,指出排序字段不能有重复的值。

For details, see Interpolate Identical Values in Different Partitions.有关详细信息,请参阅在不同分区中插入相同值

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. 从MongoDB 8.1开始,您可以在Linux系统上使用net.maxIncomingConnections配置文件选项设置的最大传入连接数为(RLIMIT_NOFILE/2)*0.8。If you specify a larger value, MongoDB uses the default value.如果指定较大的值,MongoDB将使用默认值。

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.从MongoDB 8.1开始,$convert在尝试在不同binData子类型之间转换时返回错误。在MongoDB 8.0中,$convert返回原始值和原始子类型:不执行转换。8.0之前的MongoDB版本没有binData转换。

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. 如果对集合使用errorAndLog验证操作,则MongoDB无法降级,除非您删除该集合,或者将该集合的验证操作更改为旧版本支持的操作。To change the validation action on a collection, use the collMod command.要更改集合的验证操作,请使用collMod命令。

Deprecations反对使用

Deprecated已弃用Description描述

metadataRefreshInTransactionMaxWaitBehindCritSecMS

Starting in MongoDB 8.1, the old metadataRefreshInTransactionMaxWaitBehindCritSecMS parameter is renamed metadataRefreshInTransactionMaxWaitMS. You can continue to use metadataRefreshInTransactionMaxWaitBehindCritSecMS as the parameter name, but it is deprecated and will be removed in a future MongoDB release.从MongoDB 8.1开始,旧的metadataRefreshInTransactionMaxWaitBehindCritSecMS参数被重命名为metadataRefreshInTransactionMaxWaitMS。您可以继续使用metadataRefreshInTransactionMaxWaitBehindCritSecMS作为参数名称,但它已被弃用,并将在未来的MongoDB版本中删除。

For details, see metadataRefreshInTransactionMaxWaitMS.有关详细信息,请参阅metadataRefreshInTransactionMaxWaitMS