MongoDB 5.0 marks the start of a new release cycle to deliver new features to users more quickly.
Time series data
MongoDB 5.0 supports native time series data, i.e., highly time-related continuous data, and provides various capabilities such as time series collection and cluster index. They greatly expand MongoDB's application in the fields of IoT, finance, monitoring system, log analysis, and financial analysis.
Live resharding
MongoDB 5.0 supports changing a collection's shardkey as needed through the reshardCollection
command as the workload grows and changes while the business is running. The entire process is easy and efficient, without stopping the database service or requiring complicated migration. The syntax format of this command is as follows:
reshardCollection: "database.collection", key: shardkey
database: Select the name of the database that needs to be resharded.
collection: Select the name of the collection that needs to be resharded.
shardkey: Specify the new shard key.
Versioned API
With versioned API, MongoDB 5.0 defines a set of commands and parameters most commonly used by applications in a versioned manner, including those used to read and write data and create collections and indexes. A new version of such an API may have new parameters, aggregation operators, or commands added but must be backward compatible. In this way, application developers no longer have to worry about compatibility issues after database version upgrade. As long as the database version supports this API version, applications can continue to run with no adaptation needed. The decoupling of application lifecycle and database lifecycle helps users try out MongoDB's new features faster and more conveniently.
New MongoDB Shell
MongoDB 5.0 comes with a redesigned MongoDB Shell, which introduces syntax highlighting, smart self-service contextual help, and helpful error messages for a more modern command line experience.
Adjustment of the default value of the write concern policy
In versions earlier than MongoDB 5.0, the write concern defaults to w=1
, and the system only waits for the primary node to complete the write operation before returning a message confirming that the write is successful. Starting from MongoDB 5.0, the write concern defaults to w=majority
, that is, only after the data write is applied to the primary node and data is written by the majority of voting nodes will an acknowledgment be sent to the client. This enhances the data reliability. For more information, see Write Concern. Version release adjustment
The versions released by MongoDB are divided into major releases and rapid releases. Rapid releases provide download and testing experience as development versions and are not recommended for use in a production environment.
Was this page helpful?