ApsaraDB for MongoDB 6.0 introduces two new features — Queryable Encryption and Cluster-to-Cluster Sync — and delivers targeted improvements to time series collections, change streams, aggregation, queries, elasticity, and security.
For the full MongoDB 6.0 release notes, see Release Notes for MongoDB 6.0.
What's new in MongoDB 6.0
| Category | Feature or area |
|---|---|
| New features | Queryable Encryption |
| Cluster-to-Cluster Sync | |
| Optimizations | Time series collections |
| Change streams | |
| Aggregation | |
| Queries | |
| Elasticity | |
| Security |
Queryable Encryption
Queryable Encryption is available for public preview only. Do not use it in production environments. For details on the preview, see MongoDB Releases Queryable Encryption Preview.
Queryable Encryption lets the client encrypt sensitive fields before they reach the database, store them as fully randomized ciphertext, and still run expressive queries against the encrypted data — without exposing plaintext to the server.
How it works
The client holds the encryption key, which it retrieves from Key Management Service (KMS). When a query is submitted, the server processes it against encrypted data and returns a ciphertext response. The client then decrypts the response locally and presents the results as plaintext.
What it provides
-
Client-side key control — only the client holds the encryption key, not the server.
-
End-to-end protection across the full data lifecycle: transmission, storage, usage, auditing, and backup.
-
Expressive queries on encrypted fields, including equality, range, prefix, suffix, and substring queries.
-
Access control — only applications authorized at the client level and users with key access can retrieve plaintext.
-
Self-contained encryption solution that removes the need to build custom security and compliance layers.
-
Reduced security concerns for Alibaba Cloud users who want to store sensitive data.
For more information, see MongoDB Releases Queryable Encryption Preview.
Cluster-to-Cluster Sync
MongoDB's existing data movement tools — mongoimport, mongoexport, mongodump, and mongorestore — handle one-time or batch transfers but do not support continuous replication between live instances.
MongoDB 6.0 introduces mongosync, a dedicated tool for continuous, uni-directional synchronization between ApsaraDB for MongoDB instances. With mongosync, you can start, stop, resume, or reverse a sync task in real time, and monitor the synchronization status throughout.
To download mongosync, see the "MongoDB Cluster-to-Cluster Sync Download" section on the Try MongoDB Tools Free page.
Time series collections
Time series collections, first released in MongoDB 5.0, have evolved across several versions with each release adding capability:
| Version | What was added |
|---|---|
| MongoDB 5.0 | Initial release |
| MongoDB 5.1 | Sharding for data distribution |
| MongoDB 5.2 | Columnar compression to reduce storage usage |
| MongoDB 5.3 | Gap filling and densification for missing data points |
| MongoDB 6.0 | Enhanced indexing, query performance, and sorting |
MongoDB 6.0 enhancements
-
Secondary and compound indexes can now be created on time series collections, improving read performance.
-
Geospatial indexes are supported, enabling location- and distance-based queries on time series data — for example, tracking temperature changes in refrigerated trucks or monitoring fuel consumption along a cargo route.
-
`last point` queries are optimized: fetching the most recent data point no longer requires a full collection scan.
-
Sorting is more efficient when using timestamps combined with clustered and secondary indexes on metadata fields.
Change streams
Change streams, introduced in MongoDB 3.6, provide change data capture (CDC) without requiring external synchronization middleware. The feature has expanded significantly since its initial release:
| Version | What was added |
|---|---|
| MongoDB 3.6 | Initial release; collection-level only; limited events; fault recovery; post-image support |
| MongoDB 4.0 | Database- and instance-level support; drop, dropDatabase, and rename events; resumeToken format changed from BinData to Hex |
| MongoDB 4.2 | $set and $unset pipeline operators; startAfter option; exception on _id field modification; removed dependency on {readConcern: majority} |
| MongoDB 5.1 | More efficient stage execution in aggregation; improved resource utilization |
| MongoDB 5.3 | Support for orphaned document updates during chunk migration |
| MongoDB 6.0 | Pre-image support; DDL event types; wallTime field |
MongoDB 6.0 enhancements
-
Pre-image support: Change events can now include the document state before the change. Prior to MongoDB 6.0, only post-images were available. For details, see Change Streams with Document Pre- and Post-Images.
-
DDL events: The following DDL statements are now captured as change events:
create,createIndexes,modify, andshardCollection. For the full list, see Change Events. -
`wallTime` field: Change events now include a
wallTimefield with a wall clock timestamp. The field supports$toDate,$tsSeconds, and$tsIncrementconversion operators.
Aggregation
MongoDB 6.0 significantly expands $lookup and $graphLookup for sharded cluster instances:
-
Sharded cluster support:
$lookupand$graphLookupare now supported on sharded cluster instances. -
Improved join support:
$lookupjoin behavior is more capable and consistent. -
Improved graph traversal:
$graphLookuphandles graph traversal more efficiently. -
Performance:
$lookupachieves up to a hundredfold improvement in performance.
For details, see $lookup (aggregation) and $graphLookup (aggregation).
Queries
MongoDB 6.0 adds the following operators: $maxN, $topN, $minN, $bottomN, $lastN, and $sortArray. These operators push computation into the database layer, reducing the amount of post-processing required in application code.
For the complete operator reference, see Aggregation Pipeline Operators.
Elasticity
Default chunk size increased from 64 MB to 128 MB
The larger default chunk size reduces how often chunks are migrated between shards, which lowers networking and routing overhead for most workloads.
`configureCollectionBalancing` command
The new configureCollectionBalancing command gives you per-collection control over two behaviors:
-
Custom chunk sizes: Set different chunk sizes for different sharded collections. For example, use 256 MB for large collections and 32–64 MB for smaller collections that need finer data distribution.
-
Automatic defragmentation: Enable automatic defragmentation of sharded collections, eliminating the need to manually run the
compactcommand to reclaim disk space.
For the full command reference, see configureCollectionBalancing.
Security
MongoDB 6.0 extends Client-Side Field Level Encryption (CSFLE) to support Key Management Interoperability Protocol (KMIP)-compliant key providers. Previously, CSFLE was limited to local Keyfile-based key management. With KMIP support, you can now use third-party key management devices alongside the built-in local Keyfile approach, which is especially useful in data migration scenarios.