Release Notes for MongoDB 7.0MongoDB 7.0发布说明
On this page本页内容
This page describes changes and new features introduced in MongoDB 7.0.本页介绍MongoDB 7.0中引入的更改和新功能。
MongoDB 7.0 is a Major Release, which means that it is supported for both MongoDB Atlas and on-premises deployments. MongoDB 7.0是一个主要版本,这意味着它同时支持MongoDB Atlas和本地部署。MongoDB 7.0 includes changes introduced in MongoDB Rapid Releases 6.1, 6.2, and 6.3. To see changes introduced in these rapid releases, see Changes Introduced in 6.X-Series Rapid Releases.MongoDB 7.0包括在MongoDB Rapid Release 6.1、6.2和6.3中引入的更改。要查看这些快速发布中引入的更改,请参阅6.X系列快速发布中的更改。
To learn more about the differences between Major and Rapid releases, see MongoDB Versioning.要了解更多关于Major和Rapid版本之间的差异,请参阅MongoDB版本控制。
Atlas Search Index ManagementAtlas搜索索引管理
Starting in MongoDB 7.0, you can manage Atlas Search indexes with 从MongoDB 7.0开始,您可以使用mongosh
methods and database commands. mongosh
方法和数据库命令管理Atlas Search索引。Atlas Search index commands are only available for deployments hosted on MongoDB Atlas, and require an Atlas cluster tier of at least M10.Atlas Search索引命令仅适用于托管在MongoDB Atlas上的部署,并且需要至少M10的Atlas集群层。
To manage Atlas Search indexes, use the following commands:要管理Atlas Search索引,请使用以下命令:
mongosh Methodsmongosh
方法
db.collection.createSearchIndex() | |
db.collection.dropSearchIndex() | |
db.collection.getSearchIndexes() | |
db.collection.updateSearchIndex() |
Database Commands数据库命令
createSearchIndexes | |
dropSearchIndex | |
updateSearchIndex |
Aggregation Stages聚合阶段
$listSampledQueries | |
$listSearchIndexes |
General Changes一般变更
Cache Refresh Time Fields缓存刷新时间字段
Starting in MongoDB 7.0, log messages for slow queries includes a new cache refresh time field.从MongoDB 7.0开始,慢速查询的日志消息包括一个新的缓存刷新时间字段。
Concurrent Storage Engine Transactions并发存储引擎事务
Starting in MongoDB 7.0, an algorithm that dynamically adjusts the number of concurrent storage engine transactions is enabled by default.从MongoDB 7.0开始,默认情况下会启用一种动态调整并发存储引擎事务数的算法。
To learn more, see 要了解更多信息,请参阅wiredTiger.concurrentTransactions
, wiredTigerConcurrentReadTransactions
, and wiredTigerConcurrentWriteTransactions
.wiredTiger.concurrentTransactions
、wiredTigerConcurrentReadTransactions
和wiredTigerConcurrentWriteTransactions
。
currentOp
Metrics度量
Starting in MongoDB 7.0, the 从MongoDB 7.0开始,currentOp
command and the db.currentOp()
method include these new fields:currentOp
命令和db.currentOp()
方法包括以下新字段:
$currentOp
(aggregation) Metrics(聚合)度量
Starting in MongoDB 7.0, the currentOp aggregation stage includes these new fields:从MongoDB 7.0开始,currentOp聚合阶段包括以下新字段:
Compound Wildcard Indexes复合通配符索引
Starting in MongoDB 7.0, you can create compound wildcard indexes. 从MongoDB 7.0开始,您可以创建复合通配符索引。A compound wildcard index has one wildcard term and one or more additional index terms.复合通配符索引具有一个通配符项和一个或多个附加索引项。
Use compound wildcard indexes to support queries on known patterns and to limit the total number of indexes in a collection.使用复合通配符索引可以支持对已知模式的查询,并限制集合中的索引总数。
Large Change Stream Events大型变更流事件
Starting in MongoDB 7.0, if you have change stream events larger than 16 MB, you can use the new 从MongoDB 7.0开始,如果您有大于16 MB的更改流事件,您可以使用新的$changeStreamSplitLargeEvent
stage to split the events into smaller fragments.$changeStreamSplitLargeEvent
阶段将事件拆分为更小的片段。
The following new metrics report information about large change stream events:以下新指标报告了有关大型变更流事件的信息:
Slot-Based Query Execution Engine基于插槽的查询执行引擎
Starting in MongoDB 7.0, the slot-based query execution engine improves performance for a wider range of find and aggregation queries.从MongoDB 7.0开始,基于槽的查询执行引擎提高了更广泛的查找和聚合查询的性能。
Slow query log messages慢速查询日志消息 now include a 现在包括一个queryFramework
field that indicates which query engine completed the query:queryFramework
字段,该字段指示哪个查询引擎完成了查询:
queryFramework: "classic"
indicates that the classic engine completed the query.指示经典引擎完成了查询。queryFramework: "sbe"
indicates that the slot-based query execution engine completed the query.指示基于槽的查询执行引擎完成了查询。
User Roles System Variable用户角色系统变量
Starting in MongoDB 7.0, you can use the new 从MongoDB 7.0开始,您可以使用新的USER_ROLES
system variable to return the roles of the current user.USER_ROLES
系统变量来返回当前用户的角色。
For use cases that include 有关包括USER_ROLES
, see the find, aggregation, view, updateOne, updateMany, and findAndModify examples.USER_ROLES
的用例,请参阅find
、aggregation
、view
、updateOne
、updateMany
和findAndModify
示例。
New Sharding Statistics for Chunk Migrations块迁移的新分片统计
Available starting in MongoDB 7.0 (and 6.3.2, 6.0.6, and 5.0.18).从MongoDB 7.0(以及6.3.2、6.0.6和5.0.18)开始提供。
MongoDB includes the following new sharding statistics for chunk migrations:MongoDB为区块迁移提供了以下新的分片统计信息:
shardingStatistics.countDonorMoveChunkCommitted
shardingStatistics.countDonorMoveChunkAborted
shardingStatistics.totalDonorMoveChunkTimeMillis
shardingStatistics.countBytesClonedOnRecipient
shardingStatistics.countDocsClonedOnCatchUpOnRecipient
shardingStatistics.countBytesClonedOnCatchUpOnRecipient
New Slow Query Log Message新建慢速查询日志消息
Starting in MongoDB 7.0, the 从MongoDB 7.0开始,慢速查询日志消息中的totalOplogSlotDurationMicros
in the slow query log message shows the time between a write operation getting a commit timestamp to commit the storage engine writes and actually committing. mongod
supports parallel writes. However, it commits write operations with commit timestamps in any order.totalOplogSlotDurationMicros
显示了写入操作获得提交存储引擎写入的提交时间戳与实际提交之间的时间。mongod
支持并行写入。但是,它以任何顺序提交带有提交时间戳的写操作。
To learn more, see Logging Slow Operations.要了解更多信息,请参阅记录慢速操作。
New Parameters新建参数
analyzeShardKey-related Parametersanalyze分片Key相关参数
MongoDB 7.0 adds the following parameters related to the MongoDB 7.0添加了以下与analyzeShardKey
command:analyzeShardKey
命令相关的参数:
autoMergerIntervalSecs
Parameter参数
MongoDB 7.0 adds the MongoDB 7.0添加了autoMergerIntervalSecs
parameter which, when AutoMerger is enabled, specifies the amount of time between automerging rounds, in seconds. autoMergerIntervalSecs
can only be set on config servers of sharded clusters.autoMergerIntervalSecs
参数,当启用AutoMerger
时,该参数指定自动合并轮次之间的时间量,以秒为单位。autoMergerIntervalSec
只能在分片集群的配置服务器上设置。
autoMergerThrottlingMS
Parameter参数
MongoDB 7.0 adds the MongoDB 7.0添加了autoMergerThrottlingMS
which, when AutoMerger is enabled, specifies the minimum amount time between merges initiated by the AutoMerger on the same collection, in milliseconds. autoMergerThrottlingMS
,当启用AutoMerger时,它指定由AutoMerger在同一集合上启动的合并之间的最短时间,以毫秒为单位。autoMergerThrottlingMS
can only be set on config servers of sharded clusters.只能在分片集群的配置服务器上设置。
balancerMigrationsThrottlingMs
Parameter参数
MongoDB 7.0 adds the MongoDB 7.0添加了balancerMigrationsThrottlingMs
parameter which allows you to throttle the balancing rate.balancerMigrationsThrottlingMs
参数,该参数允许您调节平衡率。
gEnableDetailedConnectionHealthMetricLogLines
Parameter参数
MongoDB 7.0 adds the MongoDB 7.0添加了gEnableDetailedConnectionHealthMetricLogLines
parameter which lets you specify whether or not a set of log messages related to cluster connection health metrics appears in the log.gEnableDetailedConnectionHealthMetricLogLines
参数,用于指定日志中是否出现一组与集群连接健康指标相关的日志消息。
oidcIdentityProviders
Parameter参数
MongoDB 7.0 adds the MongoDB 7.0添加了oidcIdentityProviders
parameter which allows you to specify identity provider (IDP) configurations when using OpenID Connect authentication.oidcIdentityProviders
参数,该参数允许您在使用OpenID Connect身份验证时指定身份提供程序(IDP)配置。
configureQueryAnalysis-related
Parameters参数
MongoDB 7.0 adds the following parameters related to the MongoDB 7.0添加了以下与configureQueryAnalysis
command:configureQueryAnalysis
命令相关的参数:
Security安全
Queryable Encryption General Availability可查询加密常规可用性
Starting in MongoDB 7.0, Queryable Encryption with equality queries is generally available (GA). 从MongoDB 7.0开始,通常可以使用具有相等查询的可查询加密。Improvements in the GA make it incompatible with the Queryable Encryption Public Preview, which should not be used now that the feature is GA. GA中的改进使其与Queryable Encryption Public Preview不兼容,因为该功能已经是GA,所以不应该使用它。For details, see Compatibility Changes in MongoDB 7.0.有关详细信息,请参阅MongoDB 7.0中的兼容性更改。
KMIP 1.0 and 1.1 SupportKMIP 1.0和1.1支持
MongoDB 7.0 (and 6.0.6) adds the MongoDB 7.0(和6.0.6)添加了useLegacyProtocol
setting. useLegacyProtocol
设置。This setting allows MongoDB servers to connect to KMIP servers that use KMIP protocol version 1.0 or 1.1.此设置允许MongoDB服务器连接到使用KMIP协议版本1.0或1.1的KMIP服务器。
OpenSSL and FIPS SupportOpenSSL和FIPS支持
Starting in MongoDB 7.0 and 6.0.7, MongoDB supports OpenSSL 3.0 and the OpenSSL FIPS provider with these operating systems:从MongoDB 7.0和6.0.7开始,MongoDB支持以下操作系统的OpenSSL 3.0和OpenSSL FIPS提供程序:
Red Hat Enterprise Linux 9Red Hat Enterprise Linux 9- Amazon Linux 2023
- Ubuntu Linux 22.04
For details, see TLS/SSL (Transport Encryption).有关详细信息,请参阅TLS/SSL(传输加密)。
OpenID ConnectOpenID连接
Starting in 7.0, MongoDB Enterprise provides support for OpenID Connect authentication. OpenID Connect is an authentication layer built on top of OAuth2. You can use OpenID Connect to configure single sign-on between your MongoDB database and a third-party identity provider.从7.0开始,MongoDB Enterprise提供了对OpenID Connect身份验证的支持。OpenIDConnect是一个建立在OAuth2之上的身份验证层。您可以使用OpenIDConnect在MongoDB数据库和第三方身份提供商之间配置单一登录。
Aggregation聚合
New operators:新运算符:
$median | |
$percentile |
Time Series时间序列
MongoDB 7.0 removes most of the time series limitations from these operations that are based on the MongoDB 7.0从这些基于delete
command:delete
命令的操作中删除了大部分时间序列限制:
Sharding分片
mergeAllChunksOnShard
Command命令
Starting in MongoDB 7.0, the 从MongoDB 7.0开始,mergeAllChunksOnShard
command finds and merges all mergeable chunks that a shard owns for a given collection.mergeAllChunksOnShard
命令查找并合并一个分片为给定集合拥有的所有可合并块。
The AutoMerger自动合并
Starting in MongoDB 7.0, the AutoMerger can automatically merge chunks that meet the mergeability requirements. 从MongoDB 7.0开始,AutoMerger可以自动合并满足可合并性要求的块。The AutoMerger is enabled by default.自动合并在默认情况下处于启用状态。
Starting in MongoDB 7.0, you can use the following methods to control the AutoMerger behavior:从MongoDB 7.0开始,您可以使用以下方法来控制AutoMerger行为:
enableAutoMerger Parameter for configureCollectionBalancingenableAutoMerger
参数用于configureCollectionBalancing
Starting in MongoDB 7.0, the 从MongoDB 7.0开始,configureCollectionBalancing
command accepts the enableAutoMerger
parameter. configureCollectionBalancing
命令接受enableAutoMerger
参数。Use 使用enableAutoMerger
to set whether or not the AutoMerger takes this collection into account.enableAutoMerger
设置AutoMerger是否考虑此集合。
rangeDeleterHighPriority
Parameter for Deprioritizing Range deletions参数用于取消范围删除优先级
Starting in MongoDB 7.0, you can prioritize or deprioritize cleanup of orphaned documents over user operations using the 从MongoDB 7.0开始,您可以使用rangeDeleterHighPriority
parameter.rangeDeleterHighPriority
参数将孤立文档的清理优先级设置为高于用户操作的优先级或取消优先级。
operationsBlockedByRefresh
Metrics Removed已删除度量
MongoDB 7.0 removes the MongoDB 7.0删除了operationsBlockedByRefresh
document that contains statistics about operations blocked by catalog cache refresh activity because the operationsBlockedByRefresh
counters increased on mongos
for every operation that used collection routing information even if the operation wasn't blocked by a catalog refresh activity.operationsBlockedByRefresh
文档,该文档包含有关目录缓存刷新活动阻止的操作的统计信息,因为对于每个使用集合路由信息的操作,即使该操作没有被目录刷新活动阻止,mongos
上的operationsBlockedByRefresh
计数器也会增加。
analyzeShardKey
Command and 命令和db.collection.analyzeShardKey()
Method方法
MongoDB 7.0 adds the MongoDB 7.0添加了analyzeShardKey
command and the db.collection.analyzeShardKey()
method, which let you calculate metrics for evaluating a shard key.analyzeShardKey
命令和db.collection.analyzeShardKey()
方法,可以计算评估分片键的指标。
configureQueryAnalyzer
Command and 命令和db.collection.configureQueryAnalyzer()
Method方法
MongoDB 7.0 adds the MongoDB 7.0添加了configureQueryAnalyzer
command, which allows you to configure query sampling for a collection. configureQueryAnalyzer
命令,该命令允许您为集合配置查询采样。MongoDB 7.0 also adds the MongoDB 7.0还添加了db.collection.configureQueryAnalyzer()
, which wraps the configureQueryAnalyzer
command. Sampled queries provide information to analyzeShardKey
to calculate metrics about read and write distribution of a shard key.db.collection.configureQueryAnalyzer()
,它封装了configQueryAnalyzer
命令。采样查询为analyzeShardKey
提供信息,以计算有关分片键的读写分布的度量。
serverStatus
Output Change输出更改
serverStatus
includes the following new fields in its output:在其输出中包括以下新字段:
Plan Cache Metrics计划缓存指标queryAnalyzer MetricsqueryAnalyzer
度量
Changes Introduced in 6.X-Series Rapid Releases6X系列快速发布中引入的更改
MongoDB 7.0 includes changes and features from the following Rapid Release versions:MongoDB 7.0包含以下快速发布版本的更改和功能:
Platform Support平台支持
Removed Platforms拆除的平台
MongoDB 7.0 removes support for RHEL 7 / CentOS 7 / Oracle 7 on the PPC64LE and s390x architectures.
Upgrade Procedures升级过程
Feature Compatibility Version功能兼容性版本
To upgrade to MongoDB 7.0 from a 6.0 deployment, the 6.0 deployment must have 要从6.0部署升级到MongoDB 7.0,6.0部署必须将featureCompatibilityVersion
set to 6.0
. featureCompatibilityVersion
设置为6.0。To check the version:要检查版本:
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
To upgrade to MongoDB 7.0, refer to the upgrade instructions specific to your MongoDB deployment:要升级到MongoDB 7.0,请参阅针对您的MongoDB部署的升级说明:
Upgrade a Standalone to 7.0将单机版升级到7.0Upgrade a Replica Set to 7.0将副本集升级到7.0Upgrade a Sharded Cluster to 7.0将分片 Cluster升级至7.0
If you need guidance on upgrading to 7.0, MongoDB professional services offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application. 如果您需要升级到7.0的指导,MongoDB专业服务提供主要版本升级支持,以帮助确保在不中断MongoDB应用程序的情况下顺利过渡。To learn more, see MongoDB Consulting.要了解更多信息,请参阅MongoDB咨询。
Downgrade Considerations降级注意事项
Only Single-Version Downgrades are Supported仅支持单一版本降级
MongoDB only supports single-version downgrades. MongoDB只支持单版本降级。You cannot downgrade to a release that is multiple versions behind your current release.您不能降级到比当前版本落后多个版本的版本。
For example, you may downgrade a 7.0-series to a 6.0-series deployment. 例如,您可以将7.0系列部署降级为6.0系列部署。However, further downgrading that 6.0-series deployment to a 5.0-series deployment is not supported.但是,不支持将6.0系列部署进一步降级为5.0系列部署。
Downgrade Policy Changes降级策略更改
Starting in MongoDB 7.0:在MongoDB 7.0中启动:
Binary downgrades are no longer supported for MongoDB Community Edition.MongoDB社区版不再支持二进制降级。You cannot downgrade your deployment's fCV to or from a rapid release version of MongoDB.您不能将部署的fCV降级到MongoDB的快速发布版本或从快速发布版本降级。ThesetFeatureCompatibilityVersion
command requires an additional parameter,confirm
, which must be set totrue
to upgrade or downgrade fCV.setFeatureCompatibilityVersion
命令需要一个额外的参数confirm
,该参数必须设置为true
才能升级或降级fCV。If you upgrade or downgrade your deployment's fCV, you cannot downgrade your Enterprise deployment's binary version without assistance from support.如果升级或降级部署的fCV,则在没有支持的帮助下无法降级企业部署的二进制版本。
Backward-Incompatible Features向后不兼容的功能
MongoDB 7.0 includes features that are not compatible with earlier releases. MongoDB 7.0包含与早期版本不兼容的功能。Downgrading from 7.0 to an earlier release requires that you remove data that uses these features.从7.0降级到早期版本需要删除使用这些功能的数据。
For more information, see Backward-Incompatible Features.有关详细信息,请参阅向后不兼容功能。
Download下载
To download MongoDB 7.0, go to the MongoDB Download Center.要下载MongoDB 7.0,请访问MongoDB下载中心。
Report an Issue报告问题
To report an issue, see the MongoDB GitHub repository要报告问题,请参阅MongoDB GitHub存储库 for instructions on how to file a JIRA ticket for the MongoDB server or one of the related projects.
,了解如何为MongoDB服务器或某个相关项目提交JIRA票证的说明。