The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.

Overview of New Features in v6.0

Last updated: 2025-02-08 10:05:12

This article lists the main features introduced in TencentDB for MongoDB v6.0. For details, see MongoDB 6.0 release-notes.

Time Series Collection Augmentation

MongoDB v6.0 has made multiple improvements in time series collections, including indexing, querying, and sorting, to provide stronger time series data processing capability.
First, MongoDB v6.0 introduces secondary and compound indexes, significantly enhancing the read performance of time series collections. In previous versions, time series collections only supported basic single-key indexes, which could lead to performance bottlenecks when handling large amounts of data. By introducing secondary and compound indexes, developers can create more complex index structures based on actual needs, thereby improving query performance.
Secondly, MongoDB v6.0 introduces Geo-Indexing for spatiotemporal data. This allows developers to add geographic information to time series data, enabling better analysis of scenarios involving distance and location.
Additionally, MongoDB v6.0 optimizes the query performance of time series data. In previous versions, querying the last data point in time series data required scanning the entire collection, which could result in high query latency. In MongoDB v6.0, an optimized last point query mechanism is introduced, allowing direct retrieval of the last data point in the collection without scanning the entire collection.
Finally, MongoDB v6.0 also optimizes the sorting performance of time series data. By using clustered indexes and secondary indexes on time and metadata fields, MongoDB v6.0 can perform sorting operations on time series data more efficiently. This enables developers to sort time series data as needed for better analysis and visualization.
Overall, the time series collection augmentation in MongoDB v6.0 provides developers with more powerful data processing capabilities, helping them build high-performance time series data applications more easily.

Change Streams

Change Streams allow business systems to obtain real-time change information from the database and build various event-driven applications or systems based on this. By using change streams, developers can avoid using complex data synchronization middleware, thus simplifying the architecture and improving reliability.
In MongoDB v6.0, change streams support viewing the pre-change view, which means the document state before and after change can be obtained. Additionally, change streams support various DDL statements, including create, createIndexes, modify, and shardCollection, enabling developers to more comprehensively monitor database changes.
In change events, MongoDB v6.0 introduces a new wallTime field, which contains timestamp information and supports various conversion and display operators (including $toDate, $tsSeconds, and tsIncrement). For more information, see Change Events.

Aggregation

MongoDB v6.0's aggregation feature has been further enhanced, allowing users to process multiple documents more efficiently and return calculation results. By combining multiple operators in the aggregation pipeline, users can build complex data processing pipelines to extract and analyze data. Here are some new features and optimizations in MongoDB v6.0's aggregation feature:
Sharded cluster instances support $lookup and $graphLookup, providing stronger data processing and analysis capability. For more information, see $lookup (aggregation) and $graphLookup (aggregation).
Optimized $lookup support for joins, making it more efficient when handling join operations between multiple collections.
Optimized $graphLookup support for graph traversal, making it more efficient when handling complex graph data structures.

Query

In MongoDB v6.0, the query feature has been further enhanced with the introduction of a series of new operators, including $maxN, $topN, $minN, $bottomN, $lastN, and $sortArray. By using these operators, developers can handle complex query requirements more efficiently. For more information, see Aggregation Pipeline Operators.