Navigation
This is an upcoming (i.e. in progress) version of the manual.

Compatibility Changes in MongoDB 4.4 (Development Series 4.3.x)

MongoDB 4.4 Dev Series (4.3.x) Available

MongoDB 4.4 is currently in development as part of the 4.3 development series. While the 4.3-dev-series are available, these versions of MongoDB are for testing purposes only and not for production use.

Removed Commands

MongoDB removes the following command(s) and mongo shell helper(s):

Removed Command Removed Helper Alternatives
cloneCollection db.cloneCollection()
planCacheListPlans PlanCache.getPlansByQuery()
planCacheListQueryShapes PlanCache.listQueryShapes()

Removed Parameters

MongoDB removes the following server parameter:

Removed Parameter Description
failIndexKeyTooLong MongoDB 4.4 removes the failIndexKeyTooLong parameter. This parameter was deprecated in 4.2 as MongoDB with featureCompatibilityVersion (fCV) version 4.2+ no longer imposes an Index Key Limit.

Replica Sets

Rollback Directory

Starting in Mongo 4.4, the rollback directory for a collection is named after the collection’s UUID rather than the collection namespace; e.g.

<dbpath>/rollback/20f74796-d5ea-42f5-8c95-f79b39bad190/removed.2020-02-19T04-57-11.0.bson

For details, see Rollback Data.

replSetGetStatus Output Field Changes

The replSetGetStatus command and its mongo shell helper rs.status() removes the following deprecated fields from its output:

Removed Field Alternative
syncingTo Use syncSourceHost instead.
members[n].syncingTo Use members[n].syncSourceHost instead.

db.collection.validate() Parameter Change

With the ability to run validate in background, the mongo method db.collection.validate() no longer accepts just a boolean parameter.

That is, the method no longer accepts db.collection.validate(<boolean>) as a shorthand for db.collection.validate({full: <boolean>}):

Instead of: Use
db.collection.validate(true) db.collection.validate({ full: true })
db.collection.validate(false)
db.collection.validate() -or-
db.collection.validate({ full: false })

Projection Restrictions

  • Starting in MongoDB 4.4, you cannot specify both an embedded document and a field within that embedded document in the same projection.

    The following projection document fails with a Path collision error because it attempts to project both the embedded size document and the size.uom field:

    db.inventory.find( {}, { size: 1, "size.uom": 1 } )
    

    The error occurs regardless of the order in which the parent document and embedded field are specified. The following example fails with the same error:

    db.inventory.find( {}, { "size.uom": 1, size: 1 } )
    

    In MongoDB versions prior to 4.4, the operation does not result in an error. The result depends on the order in which the fields are specified in the projection document.

    • If the parent document is specified before the embedded field, the operation only returns the embedded field.

      The projection document { size: 1, "size.uom": 1 } produces the same result as the document { "size.uom": 1 }.

    • If the embedded field is specified before the parent document the operation returns the entire size document.

      The projection document { "size.uom": 1, size: 1 } produces the same result as the document { size: 1 }.

$meta Behavior Changes

General Changes

4.4 Feature Compatibility

Some features in 4.4 require not just the 4.4 binaries but the featureCompatibilityVersion (fCV) set to 4.4. These features include: