www.mongodb.com Open in urlscan Pro
2600:9000:2490:a000:7:7859:3840:93a1  Public Scan

Submitted URL: https://s413370795.t.en25.com/e/er?utm_campaign=Int_EM_End%20Of%20Life%20For%20Mongodb%204.2%20April%202023%20And%20Ops%20Mana...
Effective URL: https://www.mongodb.com/docs/v6.0/release-notes/6.0/?utm_campaign=Int_EM_End%20Of%20Life%20For%20Mongodb%204.2%20April%2...
Submission: On April 21 via api from IN — Scanned from DE

Form analysis 2 forms found in the DOM

GET https://mongodb.com/docs/search/

<form role="search" method="GET" action="https://mongodb.com/docs/search/" class="css-dc0gsv">
  <div class="css-1q5aj3">
    <div class="css-36i4c2"><input type="text" placeholder="Search all documentation..." class="css-etrcff" value=""></div>
    <div class="css-1hc92ka">
      <div class="css-aef77t"><button role="label" type="button" class="css-14k7wrz"><span data-testid="selected-value" class="css-6k4l2y">All Documentation</span>
          <div class="css-109dpaz"><svg data-testid="icon" width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" class="css-1yzkxhp">
              <path d="M1.06689 0.799988L8.00023 7.73332L14.9336 0.799988" stroke-linecap="round" stroke-linejoin="round" class="css-1tlq8q9"></path>
            </svg></div>
        </button>
        <div class="css-hn9qqo">
          <ul data-testid="options" role="listbox" class="css-ac9zo2">
            <li role="option" tabindex="0" class="css-11dtrvq">General Information</li>
            <li role="option" tabindex="0" class="css-11dtrvq">All Documentation</li>
            <li role="option" tabindex="0" class="css-11dtrvq">Realm Documentation</li>
            <li role="option" tabindex="0" class="css-11dtrvq">Developer Articles &amp; Topics</li>
            <li role="option" tabindex="0" class="css-11dtrvq">Community Forums</li>
            <li role="option" tabindex="0" class="css-11dtrvq">Blog</li>
            <li role="option" tabindex="0" class="css-11dtrvq">University</li>
          </ul>
        </div>
      </div><input type="hidden" id="q" name="q" value=""><input type="hidden" id="searchProperty" name="searchProperty" value="manual-v6.0">
      <div class="css-1myrko"><button type="submit" tabindex="0" class=" css-13l1z36" data-track="true"><img alt="search icon" src="https://webimages.mongodb.com/_com_assets/cms/krc3hljsdwdfd2w5d-web-actions-search.svg?auto=format%252Ccompress"
            class="css-r9fohf"></button></div>
    </div>
  </div>
</form>

GET https://mongodb.com/docs/search/

<form role="search" method="GET" action="https://mongodb.com/docs/search/" class="css-11a71ad">
  <div class="css-7590ag"><input type="text" placeholder="Search all documentation..." class="css-xrkki1" value=""></div>
  <div class="css-itzitu"><select class="select-overlay css-15v6p12" id="filter-select">
      <option value="General Information">General Information</option>
      <option value="All Documentation" selected="">All Documentation</option>
      <option value="Realm Documentation">Realm Documentation</option>
      <option value="Developer Articles &amp; Topics">Developer Articles &amp; Topics</option>
      <option value="Community Forums">Community Forums</option>
      <option value="Blog">Blog</option>
      <option value="University">University</option>
    </select><input type="hidden" id="q" name="q" value=""><input type="hidden" id="searchProperty" name="searchProperty" value="manual-v6.0">
    <div class="css-1myrko"><button type="submit" tabindex="0" class=" css-31biy7" data-track="true">Search</button></div>
  </div>
</form>

Text Content

___

All Documentation

 * General Information
 * All Documentation
 * Realm Documentation
 * Developer Articles & Topics
 * Community Forums
 * Blog
 * University


 * Products
   Atlas→
   
   Developer data platform
   
   --------------------------------------------------------------------------------
   
   Enterprise Advanced→
   
   Enterprise software and support
   
   --------------------------------------------------------------------------------
   
   Community Edition→
   
   Free software used by millions
   
   --------------------------------------------------------------------------------
   
    * Database→
    * Search→
    * Data Lake (Preview)→
    * Charts→
    * Device Sync→
    * APIs, Triggers, Functions→
   
    * Enterprise Server→
    * Ops Manager→
    * Enterprise Kubernetes Operator→
   
    * Community Server→
    * Cloud Manager→
    * Community Kubernetes Operator→
   
   
   Tools→
   
   Build faster
   
   --------------------------------------------------------------------------------
   
    * Compass→
    * Shell→
    * VS Code Plugin→
    * Atlas CLI→
    * Database Connectors→
    * Cluster-to-Cluster Sync→
    * Mongoose ODM Support→
    * Relational Migrator→
   
   
 * Solutions
   
   By Industry
   
   
   
   --------------------------------------------------------------------------------
   
   By Use Case
   
   
   
   --------------------------------------------------------------------------------
   
    * Financial Services→
    * Telecom→
    * Healthcare→
    * Retail→
    * Public Sector→
    * Manufacturing→
    * All Industries→
   
    * Analytics→
    * Internet of Things→
    * Mobile→
    * Payments→
    * Serverless Development→
    * All Use Cases→
   
   
   
   Developer Data Platform
   
   Innovate fast at scale with a unified developer experience
   
   Learn More
   
   --------------------------------------------------------------------------------
   
   White Papers & Presentations
   
   Webinars, white papers, datasheets and more
   
   View All
 * Resources
   Documentation→
   
   
   
   --------------------------------------------------------------------------------
   
    * Atlas→
    * Server→
    * Drivers→
   
    * Develop Applications→
    * Launch and Manage MongoDB→
    * View and Analyze→
    * Start with Guides→
   
   
   
   Community
   
   
   
   --------------------------------------------------------------------------------
   
   Education
   
   
   
   --------------------------------------------------------------------------------
   
    * Developer Center→
    * Events & Webinars→
    * Forums→
    * Champions→
    * Find a User Group→
   
    * University→
    * Certification→
    * Academia→
    * Intro to MongoDB Course→
    * Browse All Courses→
   
   
 * Company
   
   About
   
   
   
   --------------------------------------------------------------------------------
   
   Services
   
   
   
   --------------------------------------------------------------------------------
   
   Partnerships
   
   
   
   --------------------------------------------------------------------------------
   
    * Who We Are→
    * Customer Stories→
    * Blog→
    * Careers→
    * Pressroom→
    * Leadership→
    * Investors→
   
    * Consulting→
    * Training→
    * Customer Support→
    * Customer Success→
   
    * Become a Partner→
    * Find a Partner→
    * MongoDB for Startups→
   
   
 * Pricing

Sign In
Try Free

General InformationAll DocumentationRealm DocumentationDeveloper Articles &
TopicsCommunity ForumsBlogUniversity
Search
Docs Menu
   
   MongoDB Documentation
   
   --------------------------------------------------------------------------------
   
   Back to Develop Applications
 * MongoDB Manual
   6.0 (current)
   Introduction
   Installation
   MongoDB Shell (mongosh)
   MongoDB CRUD Operations
   Aggregation Operations
   Data Models
   Indexes
   Security
   Replication
   Sharding
   Change Streams
   Time Series
   Transactions
   Administration
   Storage
   Frequently Asked Questions
   Reference
   Release Notes
   Release Notes for MongoDB 6.0
   Compatibility Changes in MongoDB 6.0
   Downgrade 6.0 to 5.0
   Upgrade 5.0 to 6.0
   6.0 Changelog
   Release Notes for MongoDB 5.3
   Release Notes for MongoDB 5.2
   Release Notes for MongoDB 5.1
   Release Notes for MongoDB 5.0
   Release Notes for MongoDB 4.4
   Release Notes for MongoDB 4.2
   Release Notes for MongoDB 4.0
   Release Notes for MongoDB 3.6
   Release Notes for MongoDB 3.4
   Release Notes for MongoDB 3.2
   Release Notes for MongoDB 3.0
   Release Notes for MongoDB 2.6
   Release Notes for MongoDB 2.4
   Release Notes for MongoDB 2.2
   Release Notes for MongoDB 2.0
   Release Notes for MongoDB 1.8
   Release Notes for MongoDB 1.6
   Release Notes for MongoDB 1.4
   Release Notes for MongoDB 1.2.x
   MongoDB Versioning
   Technical Support

 * 



Docs Home → Develop Applications → MongoDB Manual


RELEASE NOTES FOR MONGODB 6.0


On this page

 * Patch Releases
 * Aggregation
 * Change Streams
 * Cluster Administration
 * Clustered Collections
 * Indexes
 * Installation
 * Platform Support
 * Replica Sets
 * Security
 * Server Parameters
 * Sharding
 * Slot-Based Query Execution Engine
 * Stable API
 * Time Series Collections
 * General Improvements
 * Changes Affecting Compatibility
 * Upgrade Procedures
 * Known Issues
 * Report an Issue

This page describes changes and new features introduced in MongoDB 6.0.

MongoDB 6.0 is a Major Release, which means that it is supported for both
MongoDB Atlas and on-premises deployments. MongoDB 6.0 includes changes
introduced in MongoDB Rapid Releases 5.1, 5.2, and 5.3. This page describes
changes introduced in those Rapid Releases and MongoDB 6.0.

To learn more about the differences between Major and Rapid releases, see
MongoDB Versioning.


WARNING


PAST RELEASE LIMITATIONS

Some past releases have critical issues. These releases are not recommended for
production use. Use the latest available patch release version instead.

Issue
Affected Versions
SERVER-68511
6.0.0
WT-10461
6.0.0 - 6.0.4 (ARM64 or POWER system architectures)


PATCH RELEASES



6.0.5 - MAR 13, 2023



WARNING

If you upgrade an existing instance of MongoDB to MongoDB 6.0.5, that instance
may fail to start if fork: true is set in the mongod.conf file.

The upgrade issue affects all MongoDB instances that use .deb or .rpm
installation packages. Installations that use the tarball (.tgz) release or
other package types are not affected. For more information, see SERVER-74345.

To remove the fork: true setting, run these commands from a system terminal:

systemctl stop mongod.servicesed -i.bak '/fork: true/d' /etc/mongod.confsystemctl start mongod.service



The second systemctl command starts the upgraded instance after the setting is
removed.

Issues Fixed:

 * SERVER-61909 Hang inserting or deleting document with large number of index
   entries

 * SERVER-66469 Filtering timeseries with date-field does not include results
   from before 1970

 * SERVER-68122 Investigate replicating the collection WiredTiger config string
   during initial sync

 * SERVER-70395 Slot-Based Engine too aggressively uses disk for $group and is
   slow

 * SERVER-73232 Change the default log-verbosity for _killOperations

 * All JIRA issues closed in 6.0.5

 * 6.0.5 Changelog


6.0.4 - JAN 26, 2023


Issues Fixed:

 * SERVER-72416 The find and findAndModify projection code does not honor the
   collection level collation

 * SERVER-71759 dataSize command doesn't yield

 * SERVER-70237 Chunks merge commit must not create a BSON object too large

 * SERVER-72222 mapReduce with single reduce optimization fails when merging
   results in sharded cluster

 * WT-9268 Delay deletion of the history store record to reconciliation

 * All JIRA issues closed in 6.0.4

 * 6.0.4 Changelog


6.0.3 - NOV 21, 2022


Issues fixed:

 * SERVER-66289 $out incorrectly throws BSONObj size error on v5.0.8

 * SERVER-68139 Resharding command fails if the projection sort is bigger than
   100MB

 * SERVER-68371 Enabling CSFLE in your MongoClient causes Atlas Search to fail

 * SERVER-68115 Bug fix for "elemMatchRootLength > 0" invariant trigger

 * SERVER-68394 Ensure we do not yield strong locks upon startup recovery when
   _id index is missing

 * All JIRA issues closed in 6.0.3

 * 6.0.3 Changelog


6.0.2 - SEP 28, 2022


Issues fixed:

 * SERVER-68925 Reintroduce check table logging settings at startup (revert
   SERVER-43664)

 * SERVER-68628 Retrying a failed resharding operation after a primary failover
   can lead to server crash or lost writes

 * SERVER-63852 getThreadName() should not crash

 * SERVER-65317 mongod removes connection from connection pool after running
   simple $search query

 * SERVER-63843 Don't allow recursive doLog in synchronous signal handlers

 * WT-9870 Fix updating pinned timestamp whenever oldest timestamp is updated
   during recovery

 * All JIRA issues closed in 6.0.2

 * 6.0.2 Changelog


6.0.1 - AUG 19, 2022


Issues fixed:

 * SERVER-68511 MovePrimary update of config.databases entry must use dotted
   fields notation

 * SERVER-68062 Multi-stage aggregations that use $geoNear may violate
   constraints

 * SERVER-66072 $match sampling and $group aggregation strange behavior

 * SERVER-68130 AutoSplitVector could generate response bigger than
   BSONObjMaxUserSize

 * SERVER-68209 Remove uassert that prevents config.image_collection entry from
   being invalidated

 * All JIRA issues closed in 6.0.1

 * 6.0.1 Changelog


6.0.0 - JUL 19, 2022


The rest of this page describes changes and new features introduced in MongoDB
6.0.


AGGREGATION



NEW AGGREGATION STAGES


MongoDB 6.0 introduces the following aggregation stages:

Stage
Description
$densify
Creates new documents in a sequence of documents where values in a specified
field are missing.
$documents
Returns literal documents from input expressions.
$fill

Populates null and missing field values within documents.

$shardedDataDistribution

New in version 6.0.3: Provides size and data distribution information on sharded
collections.


NEW AGGREGATION OPERATORS


MongoDB 6.0 introduces the following aggregation operators:

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

Fills null and missing fields in a window using linear interpolation based on
surrounding field values.

$locf

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

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

Returns the incrementing ordinal from a timestamp as a long.

$tsSecond

Returns the seconds from a timestamp as a long.


$LOOKUP AND $GRAPHLOOKUP WITH SHARDED COLLECTIONS


Starting in MongoDB 5.1, the $lookup and $graphLookup aggregation stages support
sharded collections in the from parameter.

In previous versions of MongoDB, $lookup and $graphLookup only allowed for
unsharded from collections.


CHANGE STREAMS



OPTIMIZED CHANGE STREAMS


Starting in MongoDB 5.1, change streams are optimized, providing more efficient
resource utilization and faster execution of some aggregation pipeline stages.


WALLTIME CHANGE STREAM OUTPUT FIELD


Starting in MongoDB 6.0, the change stream output has a new wallTime field that
contains the server date and time of the database operation.


CHANGE STREAMS WITH DOCUMENT PRE- AND POST-IMAGES


Starting in MongoDB 6.0, you can use change streams to output the version of a
document before and after changes (the document pre- and post-images). For
examples, see Change Streams with Document Pre- and Post-Images.


CHANGE STREAM EXPANDED EVENTS


Starting in MongoDB 6.0, change streams can show additional change events for
DDL operations, like creating indexes and dropping collections.

For more information, see Expanded Events.


CLUSTER ADMINISTRATION



CLUSTER SERVER PARAMETERS


Starting in MongoDB 6.0, you can use MongoDB Cluster Parameters to modify and
retrieve configuration options for all nodes in a replica set or sharded
cluster. You can use setClusterParameter to modify cluster-wide options and
getClusterParameter to retrieve the value of a cluster parameter.


CONNECTION POOL PARAMETERS


Starting in MongoDB 6.0, you can use
ShardingTaskExecutorPoolMinSizeForConfigServers and
ShardingTaskExecutorPoolMaxSizeForConfigServers to set the minimum and maximum
sharding TaskExecutor connection pool size for configuration servers.


CHANGESTREAMOPTIONS CLUSTER PARAMETER


Starting in MongoDB 6.0, you can use changeStreamOptions to control the
retention policy of change stream pre- and post-images.


INTERNALSESSIONSREAPTHRESHOLD PARAMETER


Starting in MongoDB 6.0, you can use the new internalSessionsReapThreshold
parameter to set the session limit for internal session metadata deletion.


MULTIPLE ARBITERS UNSUPPORTED


Starting in MongoDB 5.3, support for multiple arbiters in a replica set is
disabled by default. To enable support for multiple arbiters, start each node
with the allowMultipleArbiters parameter.


CLUSTERED COLLECTIONS


Starting in MongoDB 5.3, you can create a collection with a clustered index.
Collections created with a clustered index are called clustered collections.

To learn about the benefits compared to a normal collection, see Clustered
Collections.


INDEXES


Starting in MongoDB 5.1, you can use the collMod database command to add the
expireAfterSeconds option to an existing single-field non-TTL index.

Starting in MongoDB 6.0, you can use the prepareUnique and unique options for
the collMod command to convert an existing standard index to a unique index.


PARTIAL INDEXES


Starting in MongoDB 6.0, you can use the operators $in and $or to create partial
indexes. The partialFilterExpression maximum depth is also expanded from 2 to 4.
You can now use the operators $and and $or at non-top-levels.


INSTALLATION



SELINUX POLICIES


Starting in MongoDB 5.1, there is a new SE Linux Policy for:

 * MongoDB Enterprise Server

 * MongoDB Community Edition Server

running on Red Hat Linux. The SELinux policy is for use with default
installations using rpm installer packages.


PLATFORM SUPPORT


MongoDB 6.0.3 introduces support for RHEL / CentOS / Oracle / Rocky / AlmaLinux
9.

To install MongoDB on RHEL, see:

 * Install MongoDB Community Edition on Red Hat or CentOS

 * Install MongoDB Enterprise Edition on Red Hat or CentOS


REPLICA SETS



MULTIPLE ARBITERS UNSUPPORTED


Starting in MongoDB 5.3, support for multiple arbiters in a replica set is
disabled by default. To enable support for multiple arbiters, start each node
with the allowMultipleArbiters parameter.


INITIALSYNCMETHOD PARAMETER


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.


SPECIFY SECONDARY OPLOG BATCH DELAY


Starting in MongoDB 6.0, you can use the oplogBatchDelayMillis server parameter
to specify a delay for writes of oplog batches on secondaries. Adding a short
oplog batch delay can reduce IOPS on secondaries, but adds latency for writes
with write concern "majority".

For more information, see oplogBatchDelayMillis.


SECURITY



AUDIT LOG ENCRYPTION


Starting in MongoDB 6.0 Enterprise, you can encrypt the MongoDB audit log.

To configure the audit log, see Use KMIP Server to Manage Keys for Encrypting
the MongoDB Audit Log.


SERVER PARAMETERS


mongod adds these parameters:

 * transactionTooLargeForCacheThreshold (Starting in MongoDB 6.0.5.)


SHARDING



BALANCING POLICY CHANGES


Starting in MongoDB 6.0.3, data in sharded clusters is distributed based on data
size rather than number of chunks. As a result, you should be aware of the
following significant changes in sharded cluster data distribution behavior:

 * The balancer distributes ranges of data rather than chunks. The balancing
   policy looks for evenness of data distribution rather than chunk
   distribution.

 * Chunks are not subject to auto-splitting. Instead, chunks are split only when
   moved across shards.

 * A chunk is now referred to as a range.

 * moveRange has replaced moveChunk.


DEFAULT CHUNK SIZE INCREASED FROM 64 MB TO 128 MB


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


ENABLESHARDING NO LONGER REQUIRED


Starting in MongoDB 6.0, the enableSharding command is no longer required to
shard a collection.


MONITOR DEFRAGMENTATION STATUS


Starting in MongoDB 5.3, the balancerCollectionStatus command returns detailed
information when run on a namespace going through chunk defragmentation. The
output includes the current phase of the defragmentation and how many chunks are
left to process.

To see example output, see Ongoing Defragmentation Process.


SLOT-BASED QUERY EXECUTION ENGINE


Starting in MongoDB 5.1, MongoDB uses a new query execution engine for eligible
queries, called the slot-based query execution engine. If the slot-based query
execution engine is used, new fields are included in the query explain plan
output.

 * The new query execution engine is used if possible.

 * If the new query execution engine is used, new fields are included in the
   query explain plan output.


SLOT-BASED QUERY EXECUTION ENGINE CAN EXECUTE $GROUP AND $LOOKUP STAGES


Starting in version 6.0, MongoDB uses the slot-based query execution engine to
execute eligible $group and $lookup stages when certain conditions are met.

For more information, see Slot-Based Query Execution Engine Pipeline
Optimizations.


SET SLOT-BASED QUERY EXECUTION ENGINE PLAN CACHE SIZE


You can set the size of the plan cache for the new query engine with the
planCacheSize parameter.

Increasing the plan cache size adds more cached query shapes for the query
planner. This can improve query performance, but increases memory usage.


STABLE API


The following sections describe additions to the Stable API introduced in
MongoDB 6.0.

To see the full list of database commands available in the Stable API, see
Stable API Changelog.


DATABASE COMMANDS


Starting in MongoDB 6.0, the following database commands are supported in the
Stable API:

Command
Description
Stable API Version
count
Counts the number of documents in a collection or a view. (Also available in the
Stable API for 5.0-series deployments starting in MongoDB 5.0.9.)
V1


AGGREGATION STAGES AND OPERATORS


Starting in MongoDB 6.0, the following aggregation stages and operators are
supported in the Stable API:

Stage or Operator
Description
Stable API Version
$bottom
Returns the bottom element within a group, according to the specified sort
order.
V1
$bottomN
Returns an aggregation of the bottom n elements within a group, according to the
specified sort order.
V1
$dateAdd
Increments a Date object by a specified number of time units.
V1
$dateDiff
Returns the difference between two dates.
V1
$dateSubtract
Decrements a Date object by a specified number of time units.
V1
$dateTrunc
Truncates a date.
V1
$densify

Creates new documents in a sequence of documents where certain values in a field
are missing.

V1
$firstN (aggregation accumulator)
Returns an aggregation of the first n elements within a group.
V1
$firstN (array operator)
Returns a specified number of elements from the beginning of an array.
V1
$getField
Returns the value of a specified field from a document.
V1
$lastN (aggregation accumulator)
Returns an aggregation of the last n elements within a group.
V1
$lastN (array operator)
Returns a specified number of elements from the end of an array.
V1
$locf

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

V1
$maxN (aggregation accumulator)
Returns an aggregation of the maximum value n elements within a group.
V1
$maxN (array operator)
Returns the n largest values in an array.
V1
$minN (aggregation accumulator)
Returns an aggregation of the minimum value n elements within a group.
V1
$minN (array operator)
Returns the n smallest values in an array.
V1
$setField
Adds, updates, or removes a specified field in a document.
V1
$setWindowFields
Performs operations on a specified span of documents in a collection, known as a
window, and returns the results based on the chosen window operator.
V1
$sortArray
Sorts an array based on its elements.
V1
$top
Returns the top element within a group according to the specified sort order.
V1
$topN
Returns an aggregation of the top n elements within a group, according to the
specified sort order.
V1
$tsIncrement

Returns the incrementing ordinal from a timestamp as a long.

V1
$tsSecond

Returns the seconds from a timestamp as a long.

V1

WINDOW OPERATORS


Starting in MongoDB 6.0, the following window operators are supported in the
Stable API:

Window Operator
Description
Stable API Version
$addToSet
Returns an array of all unique values that results from applying an expression
to each document.
V1
$avg
Returns the average for the specified expression. Ignores non-numeric values.
V1
$count
Returns the number of documents in the group or window.
V1
$covariancePop
Returns the population covariance of two numeric expressions.
V1
$covarianceSamp
Returns the sample covariance of two numeric expressions.
V1
$denseRank
Returns the document position (known as the rank) relative to other documents in
the $setWindowFields stage partition. There are no gaps in the ranks. Ties
receive the same rank.
V1
$derivative
Returns the average rate of change within the specified window.
V1
$documentNumber
Returns the position of a document (known as the document number) in the
$setWindowFields stage partition. Ties result in different adjacent document
numbers.
V1
$expMovingAvg
Returns the exponential moving average for the numeric expression.
V1
$first
Returns the value that results from applying an expression to the first document
in a group or window.
V1
$integral
Returns the approximation of the area under a curve.
V1
$last
Returns the value that results from applying an expression to the last document
in a group or window.
V1
$locf

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

V1
$max
Returns the maximum value that results from applying an expression to each
document.
V1
$min
Returns the minimum value that results from applying an expression to each
document.
V1
$push
Returns an array of values that result from applying an expression to each
document.
V1
$rank
Returns the document position (known as the rank) relative to other documents in
the $setWindowFields stage partition.
V1
$shift
Returns the value from an expression applied to a document in a specified
position relative to the current document in the $setWindowFields stage
partition.
V1
$stdDevPop
Returns the population standard deviation that results from applying a numeric
expression to each document.
V1
$stdDevSamp
Returns the sample standard deviation that results from applying a numeric
expression to each document.
V1
$sum
Returns the sum that results from applying a numeric expression to each
document.
V1


TIME SERIES COLLECTIONS


The following sections describe improvements and new features for time series
collections.


SHARDED TIME SERIES COLLECTIONS


MongoDB 5.1 provides support for sharded time series collections.

See:

 * Shard a Time Series Collection

 * shardCollection

 * Time Series Limitations


UPDATES AND DELETES


Starting in MongoDB 5.1, time series collections support update and delete
operations with limitations.


TIME SERIES COLUMN COMPRESSION


Starting in MongoDB 5.2, time series collections use column compression. Column
compression adds a number of innovations that work together to significantly
improve practical compression, reduce your data's overall storage on disk, and
improve read performance.

Starting in MongoDB 6.0, arrays are also compressed as part of the time series
column compression.


SUPPORT FOR $GEONEAR


Starting in MongoDB 5.3, you can use the $geoNear pipeline operator on any field
in a time series collection.


ADDITIONAL SECONDARY INDEX TYPES


You can add additional secondary index types to time series collections,
including 2dsphere and 2d indexes.

For all additional indexes and other improvements, see Time Series Secondary
Indexes in MongoDB 6.0.


SORT OPERATIONS USE SECONDARY INDEXES


Sort operations on time series collections can use indexes to improve
performance. For more information and an example, see Use Secondary Indexes to
Improve Sort Performance.


GENERAL IMPROVEMENTS



CAPPED COLLECTIONS IMPROVEMENTS


Starting in MongoDB 6.0, you can change a capped collection's maximum size,
either in bytes or in number of documents, using the collMod command. See Resize
a Capped Collection for more details.


NUMORPHANDOCS FIELD ADDED TO COLLSTATS COMMAND


Starting in MongoDB 6.0, the collStats output includes the
collStats.numOrphanDocs field that shows the number of orphaned documents in the
collection.


EXCLUDE EMBEDDED FIELDS IN SERVERSTATUS OUTPUT


Starting in MongoDB 6.0 (and 5.0.9, 4.4.15), you can exclude embedded fields
from the serverStatus output.


CONNECTIONS


Starting in MongoDB 6.0, the Mongo() connection object has the following new
methods:

 * Mongo.getWriteConcern() returns the write concern

 * Mongo.setWriteConcern() sets the write concern


SUPPORT FOR DIAGNOSTIC BACKTRACE GENERATION IN ARM64


Starting in MongoDB 6.0 (and 5.0.10, 4.4.15), diagnostic backtrace generation in
arm64 is supported.


CHANGES AFFECTING COMPATIBILITY


Some changes can affect compatibility and may require user actions. For a
detailed list of compatibility changes, see Compatibility Changes in MongoDB
6.0.


UPGRADE PROCEDURES



IMPORTANT


FEATURE COMPATIBILITY VERSION

To upgrade to MongoDB 6.0 from a 5.0 deployment, the 5.0 deployment must have
featureCompatibilityVersion set to 5.0. To check the version:

db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )



To upgrade to MongoDB 6.0, refer to the upgrade instructions specific to your
MongoDB deployment:

 * Upgrade a Standalone to 6.0

 * Upgrade a Replica Set to 6.0

 * Upgrade a Sharded Cluster to 6.0

If you need guidance on upgrading to 6.0, MongoDB professional services offer
major version upgrade support to help ensure a smooth transition without
interruption to your MongoDB application. To learn more, see MongoDB Consulting.


KNOWN ISSUES


This section describes known issues in MongoDB 6.0 and their resolution status.

In Version
Issue
Status
6.0.0
SERVER-68062: Multi-stage aggregations that use $geoNear may violate
constraints.
Resolved in 6.0.1.


REPORT AN ISSUE


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.

←  Release NotesCompatibility Changes in MongoDB 6.0 →

On this page

 * Patch Releases
 * Aggregation
 * Change Streams
 * Cluster Administration
 * Clustered Collections
 * Indexes
 * Installation
 * Platform Support
 * Replica Sets
 * Security
 * Server Parameters
 * Sharding
 * Slot-Based Query Execution Engine
 * Stable API
 * Time Series Collections
 * General Improvements
 * Changes Affecting Compatibility
 * Upgrade Procedures
 * Known Issues
 * Report an Issue

Share Feedback
© 2023 MongoDB, Inc.

About

 * Careers
 * Investor Relations
 * Legal Notices
 * Privacy Notices
 * Security Information
 * Trust Center

Support

 * Contact Us
 * Customer Portal
 * Atlas Status
 * Paid Support

Social

 * Github
 * Stack Overflow
 * LinkedIn
 * Youtube
 * Twitter
 * Twitch
 * Facebook

© 2023 MongoDB, Inc.




PRIVACY PREFERENCE CENTER

"Cookies" are small files that enable us to store information while you visit
one of our websites. When you visit any website, it may store or retrieve
information on your browser, mostly in the form of cookies. This information
might be about you, your preferences or your device and is mostly used to make
the site work as you expect it to. The information does not usually directly
identify you, but it can give you a more personalized web experience. Because we
respect your right to privacy, you can choose not to allow some types of
cookies, but essential cookies are always enabled. Click on the different
category headings to find out more and change our default settings. However,
blocking some types of cookies may impact your experience of the site and the
services we are able to offer.
MongoDB Privacy Policy
Allow All


MANAGE CONSENT PREFERENCES

STRICTLY NECESSARY COOKIES

Always Active

These cookies are necessary for the website to function and cannot be switched
off in our systems. They are usually only set in response to actions made by you
which amount to a request for services, such as setting your privacy
preferences, logging in or filling in forms. You can set your browser to block
or alert you about these cookies, but some parts of the site will not then work.
These cookies do not store any personally identifiable information.

PERFORMANCE COOKIES

Performance Cookies

These cookies allow us to count visits and traffic sources so we can measure and
improve the performance of our site. They help us to know which pages are the
most and least popular and see how visitors move around the site. All
information these cookies collect is aggregated and therefore anonymous. If you
do not allow these cookies we will not know when you have visited our site, and
will not be able to monitor its performance.

FUNCTIONAL COOKIES

Functional Cookies

These cookies enable the website to provide enhanced functionality and
personalisation. They may be set by us or by third party providers whose
services we have added to our pages. If you do not allow these cookies then some
or all of these services may not function properly.

TARGETING COOKIES

Targeting Cookies

These cookies may be set through our site by our advertising partners. They may
be used by those companies to build a profile of your interests and show you
relevant adverts on other sites. They do not store directly personal
information, but are based on uniquely identifying your browser and internet
device. If you do not allow these cookies, you will experience less targeted
advertising.

SOCIAL MEDIA COOKIES

Social Media Cookies

These cookies are set by a range of social media services that we have added to
the site to enable you to share our content with your friends and networks. They
are capable of tracking your browser across other sites and building up a
profile of your interests. This may impact the content and messages you see on
other websites you visit. If you do not allow these cookies you may not be able
to use or see these sharing tools.


BACK BUTTON PERFORMANCE COOKIES



Vendor Search Search Icon
Filter Icon

Clear
checkbox label label
Apply Cancel
Consent Leg.Interest
checkbox label label
checkbox label label
checkbox label label

Confirm My Choices


By clicking "Accept All Cookies", you agree to the storing of cookies on your
device to enhance site navigation, analyze site usage, and assist in our
marketing efforts. You can enable and disable optional cookies as desired. Read
our Privacy Policy. Read our Privacy Policy

Manage Cookies Accept All Cookies