Docs Menu

Release Notes for MongoDB 5.2

On this page

  • Patch Releases
  • Aggregation
  • Time Series Collections
  • Sharding
  • General Improvements
  • Replica Sets
  • Report an Issue
Important

MongoDB 5.2 is a rapid release and is only supported for MongoDB Atlas. MongoDB 5.2 is not supported for use on-premises. For more information, see MongoDB Versioning.

Note

MongoDB 5.2 Released January 19, 2022

Issues fixed:

MongoDB 5.2 introduces the following aggregation operators:

Operator
Description
Returns the bottom element within a group according to the specified sort order.
Returns an aggregation of the bottom n elements within a group, according to the specified sort order.
Returns an aggregation of the first n elements within a group. Distinct from the $firstN array operator.
Returns a specified number of elements from the beginning of an array. Distinct from the $firstN accumulator.
Returns an aggregation of the last n elements within a group. Distinct from the $lastN array operator.
Returns a specified number of elements from the end of an array. Distinct from the $lastN accumulator.

Last observation carried forward. Sets values for null and missing fields in a window to the last non-null value for the field.

Returns an aggregation of the n maximum valued elements within a group. Distinct from the $maxN array operator.
Returns the n largest values in an array. Distinct from the $maxN accumulator.
Returns an aggregation of the n minimum valued elements within a group. Distinct from the $minN array operator.
Returns the n smallest values in an array. Distinct from the $minN accumulator.
Returns the top element within a group according to the specified sort order. Distinct from the command top.
Returns an aggregation of the top n elements within a group, according to the specified sort order.
Sorts an array based on its elements.

Starting in MongoDB 5.2, you can convert timestamps to dates using the $convert operator. The $toDate operator can also convert timestamps.

Starting in MongoDB 5.2 and 5.0.6, aggregation operator metrics are more precise: internal processing does not inflate the counters.

Starting in MongoDB 5.2, MongoDB uses the slot-based execution query engine to execute $group stages when $group is either:

  • The first stage in the pipeline.
  • Part of a series of stages executed by the slot-based engine that occurs at the beginning of the pipeline. For example, if a pipeline begins with $match followed by $group, the $match and $group stages are executed by the slot-based engine.

In most cases, the slot-based engine provides improved performance and lower CPU and memory costs compared to the classic query engine.

See $group Optimization.

Starting in MongoDB 5.2, time series collection data is further compressed to save database space. This compression does not affect query results, nor does it negatively affect performance.

See time series collection behavior.

Starting in MongoDB 5.2, you can run sharding administration commands (such as moveChunk) on the system.buckets collection.

Starting in MongoDB 5.2, the time that a mongos was started is included in the:

Starting in MongoDB 5.2, the default chunk size is 128 megabytes. In earlier versions of MongoDB, the default chunk size is 64 megabytes.

Starting in MongoDB 5.2, the setAllowMigrations command:

Starting in MongoDB 5.2 (and 5.0.4, 5.1.0)

The metadataRefreshInTransactionMaxWaitBehindCritSecMS parameter limits the time a shard waits for a critical section within a transaction.

Starting in MongoDB 5.2, you can use the following new server parameters to configure the refresh interval for cached LDAP user information:

Starting in MongoDB 5.2, the update interval for cached user information retrieved from an LDAP server depends on ldapShouldRefreshUserCacheEntries:

Starting in MongoDB 5.2, you can omit customData from the response of the:

To omit custom data from command output, specify the showCustomData: false option.

Starting in MongoDB 5.2, the initialSyncMethod determines whether initial sync is a logical initial sync or a file copy based initial sync.

initialSyncMethod is only available in MongoDB Enterprise Server.

To report an issue, see https://github.com/mongodb/mongo/wiki/Submit-Bug-Reports for instructions on how to file a JIRA ticket for the MongoDB server or one of the related projects.

Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.