Release Notes for MongoDB 3.6

Minor Releases

3.6.15 - Nov 6, 2019

Issues fixed:

3.6.14 - Aug 26, 2019

Issues fixed:

  • SERVER-36443: Long-running queries should not cause a build-up of unused ChunkManager objects
  • SERVER-38945: SSL performance regression
  • SERVER-40134: Distinct command against a view can return incorrect results when the distinct path is multikey
  • SERVER-42055: Only acquire a collection IX lock to write the lastVote document
  • SERVER-42603: Recent service file change may cause cyclic dependencies
  • WT-4803: Implement file_max configuration for Cache Overflow mechanism
  • All JIRA issues closed in 3.6.14%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.6.14%27)
  • 3.6.14 Changelog

Note

Fixed issues include those that resolve the following CommonVulnerabilities and Exposures (CVEs):

3.6.13 - Jun 10, 2019

Issues fixed:

Note

Fixed issues include those that resolve the following CommonVulnerabilities and Exposures (CVEs):

3.6.12 - April 8, 2019

Issues fixed:

  • SERVER-35219: Regain MongoDB balancer performance with sessions
  • SERVER-39847: Migrating session info can trigger fassert when destination shard has transaction history truncated by oplog
  • SERVER-37255: replSetReconfig with concurrent election can trigger invariant
  • SERVER-39394: Views collation check should traverse through nested $lookup pipelines
  • SERVER-39487: Aggregation operator $sqrt output for NumberDecimal is the same as $exp
  • SERVER-37722: Quiet mode does not suppress connection end events
  • All JIRA issues closed in 3.6.12%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.6.12%27)
  • 3.6.12 Changelog

3.6.11 - Mar 1, 2019

Issues fixed:

3.6.10 - Jan 22, 2019

Issues fixed:

3.6.9 - Nov 16, 2018

Issues fixed:

  • SERVER-32943: Query during background index build can lead to suboptimal cached plan
  • SERVER-35657: Do not delay journal flushes when operations are waiting for oplog visibility
  • SERVER-37058: Update with numeric field names inside an array can cause validation to fail
  • SERVER-37132: Negation of $in with regex can incorrectly plan from the cache, leading to missing query results
  • All JIRA issues closed in 3.6.9%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.6.9%27)
  • 3.6.9 Changelog

3.6.8 - Sep 19, 2018

Issues fixed:

3.6.7 - Aug 25, 2018

Issues fixed:

3.6.6 - Jul 10, 2018

Issues fixed:

3.6.5 - May 29, 2018

Issues fixed:

3.6.4 - Apr 13, 2018

Issues fixed:

3.6.3 - February 23, 2018

Issues fixed:

3.6.2 - January 10, 2018

Issues fixed:

  • SERVER-31267: CollectionCloner fails if collection isdropped between getMore calls.
  • SERVER-31625: The contents of Unknown macro: {USER} needs tobe escaped when querying for the groups using LDAP server.
  • SERVER-31684: QueryPlanKilled (operation exceeded timelimit) in $changeStream with updateLookup.
  • SERVER-31982: Shard does not call config commit chunkmigration command with majority writeConcern nor checks forwriteConcern errors..
  • SERVER-32246: PID file permission on v3.6 make it notmonitorable using pid file.
  • SERVER-32255: UUIDs may be absent from shard secondary localcollections.
  • SERVER-32282: Aggregation text search returns text scoreeven if it wasn’t requested when targeting multiple shards in asharded cluster.
  • SERVER-32396mongo shell failed to connect with 3.6 connection string SRV
  • SERVER-32430: DocumentSourceSort sorts array documentsincorrectly if there is a non-simple collation.
  • SERVER-32529: Requiring replSet for shards breaks QueryableBackup.
  • All JIRA issues closed in 3.6.2%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.6.2%27)
  • 3.6.2 Changelog

3.6.1 - Dec 26, 2017

Issues fixed:

  • SERVER-30768: Primary queries using maxTimeMS causetemporary shard write unavailability if ExceededTimeLimit.
  • SERVER-31225: The mongod process forks beforelistening for connections.
  • SERVER-31885: changeStream cursor is not returned on amongos when the database does not exist.
  • SERVER-32085: changeStream reports incorrect documentKey forunsharded collections that become sharded.
  • SERVER-32046: Arrays of certain NumberDecimals can triggeran invariant failure.
  • SERVER-32048: Updates using a numeric path component maycause index entries not to be created.
  • All JIRA issues closed in 3.6.1%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.6.1%27)
  • 3.6.1 Changelog

Security

Default Bind to Localhost

Starting with MongoDB 3.6, MongoDB binaries, mongod andmongos, bind to localhost by default.From MongoDB versions 2.6 to 3.4, only the binaries from theofficial MongoDB RPM (Red Hat, CentOS, Fedora Linux, and derivatives)and DEB (Debian, Ubuntu, and derivatives) packages would bind tolocalhost by default. To learn more about this change, seeLocalhost Binding Compatibility Changes.

MONGODB-CR Deprecation

As of MongoDB 3.6, MONGODB-CR authentication mechanism isdeprecated. If you have not upgraded your MONGODB-CR authenticationschema to SCRAM, see Upgrade to SCRAM.

Authentication Restrictions

To restrict database user connections to specified IP addresses, addedauthenticationRestrictions parameter to the following:

CommandsMethods
createUserdb.createUser()
updateUserdb.updateUser()
createRoledb.createRole()
updateRoledb.updateRole()

Additional Security Enhancements

  • Added the opensslCipherConfig parameter to control theOpenSSL ciphers when using TLS/SSL encryption.

  • If authentication is turned on, you can only issue a getMoreagainst cursors you created.

  • Added the convertToCapped action to restorerole.

See also

Backwards Incompatible Features

Aggregation

The following features are available starting in MongoDB 3.6.

More Expressive $lookup

$lookup adds support for specifying multiple joinconditions as well as uncorrelated sub-queries by allowing variablespecification and pipeline execution on the joined collection.

For details, see the $lookup syntax forJoin Conditions and Uncorrelated Sub-queries.

New Aggregation Stages

MongoDB 3.6 adds the following new aggregation pipeline stages:

OperatorDescription
$currentOpReturns a stream of documents containing informationon active and/or dormant operations on a mongodinstance. Uses the new aggregation helperdb.aggregate().
$listSessionsLists server sessions in the system.sessions collection in theconfig database. Uses the new aggregation helperdb.aggregate().
$listLocalSessionsLists server sessions cached in memory by the server.

New Aggregation Operators

OperatorDescription
$arrayToObjectConverts an array of key value pairs to a document.
$objectToArrayConverts a document to an array of documents representingkey-value pairs.
$mergeObjectsCombines multiple documents into a single document.
$dateFromStringConverts a date/time string to a date object.
$dateFromPartsConstructs a BSON Date object given the date’s constituentparts.
$dateToPartsReturns a document containing the constituent parts of a date.

New Aggregation Helper

MongoDB 3.6 adds a helper, db.aggregate(), to performaggregations that do not rely on an underlying collection, suchas those that start with $currentOp or$listLocalSessions.

New Aggregation Variable

REMOVE allows for the conditional exclusion of a field.

New Options

aggregate command and thedb.collection.aggregate() method support the following new options:

  • hint option to specify the index to use.

Note

The hint does not apply to $lookup and$graphLookup stages.

  • comment option to help trace the operation through the databaseprofiler, currentOp, and logs.

Support for Time Zones

MongoDB 3.6 adds support for time zones to aggregation dateoperators.

See also

Aggregation Compatibility Changes

Array Update Operator Enhancements

arrayFilters

The following commands and methods can accept an arrayFiltersparameter to specify which elements to modify in an array field:

CommandsMethods
findAndModifydb.collection.findOneAndUpdate()db.collection.findAndModify()
updatedb.collection.updateOne()db.collection.updateMany()db.collection.update()
db.collection.bulkWrite() for updateOne andupdateMany operationsBulk.find.arrayFilters() for Bulk() operationmethods updateOne() andupdate().

Multi-Element Array Updates

MongoDB 3.6 adds the following new positional operators for updateoperations on arrays and nested arrays:

  • The all positional $[] operator updates all elements inan array.
  • The filtered positional $[<identifier>] operator updatesall elements in an array that match the arrayFilterscriteria.

Negative Array Index Position for push

The $position modifier for the push update operatorcan accept a negative array index value to indicate a position startingfrom the end of the array.

3.6 Compatible Drivers

The following drivers are feature compatible with MongoDB 3.6:

Java 3.6+Python 3.6+C 1.9+C# 2.5+Node 3.0+Ruby 2.5+Perl 2.0+PHPC 1.4+Scala 2.2+

DNS-constructed Seedlist mongodb+srv

In addition to the standard connection format, the 3.6 drivers supporta DNS-constructed seedlist. For more information, seeDNS Seedlist Connection Format.

Change Streams

MongoDB 3.6 supports opening change streams against replica sets andsharded clusters with replica set shards.

Change streams allow applications to access real-time data changeswithout the complexity and risk of tailing the oplog.Applications can use change streams to subscribe to all data changeson a collection and respond to those changes.

You can open a change stream from any 3.6-series driver using thedb.collection.watch() method. See the documentation foryour preferred driver for complete instructions on usage.

See Change Streams for more information.

Important

To use change streams, featureCompatibilityVersion must be set to“3.6”. For more information, see View FeatureCompatibilityVersion andsetFeatureCompatibilityVersion.

Client Sessions

Causal Consistency

To provide causal consistency, MongoDB 3.6 enables causalconsistency in client sessions. Acausally consistent client session denotes that the associated sequence ofread and acknowledged write operations have a causal relationshipthat is reflected by their ordering. Client applications must ensurethat only one thread at a time executes these operations in a client session.

Applications can start a client session and associate operationswith a specific session. Applications must ensure that only onethread at a time executes these operations in a client session.

Important

To use client sessions:

Retryable Writes

Important

For retryable writes:

Starting in MongoDB 3.6, certain acknowledged writeoperations on replica sets and sharded clusters are“retryable” to provide handling of transient network errors or replicaset elections.

With retryable writes, MongoDB drivers automatically retries theseoperations upon encountering network errors or encountering areplica set failover during whichtime the replica set has no primary. To enable retryable writes for the3.6 drivers, see retryWrites.

As the retry attempt is made only once, the retryable feature can helpaddress transient network errors but not persistent network errors.

For more information on retryable writes, see Retryable Writes.

mongo Shell Changes

MongoDB 3.6 adds the new command-line option —retryWrites tothe mongo shell. The option enablesRetryable Writes in themongo shell.

The following new methods have been added to the Mongo() connectionobject in the mongo shell:

Server Sessions

MongoDB’s server sessions, or logical sessions, are the underlyingframework used by client sessions tosupport Causal Consistency and retryable writes.

Important

Applications use client sessions tointerface with server sessions.

Server sessions are available for standalone mongodinstances, replica sets, and sharded clusters.

Server Session Commands

Starting in 3.6, MongoDB drivers associate all operations with a serversession, with the exception of unacknowledged writes. If the deploymentenforces authentication/authorization, server sessions are associatedwith the authenticated users.

The following commands can be used to list, manage, and kill serversessions throughout MongoDB clusters:

CommandsDescriptions
endSessionsExpires specified server sessions.
killAllSessionsKills all server sessions.
killAllSessionsByPatternKills all server sessions that match the specified pattern.
killSessionsKills specified server sessions.
refreshSessionsRefreshes idle server sessions.
startSessionStarts a new server session.

Parameters

The following new parameters are available for server sessions:

Aggregation Stages

To support server sessions, MongoDB 3.6 adds the following newaggregation pipeline stages:

OperatorDescription
$listSessionsLists the server sessions in the system.sessions collection in theconfig database.
$listLocalSessionsLists the server sessions cached in memory by the server. Usesthe new aggregation helper db.aggregate().

General

serverStatus returns information on the number oflogicalSessionRecordCache.

Command Options

Starting in 3.6, MongoDB drivers associate all operations with a serversession, with the exception of unacknowledged writes. The followingoptions are available for all commands to support association with aserver session:

Important

The mongo shell and the drivers assign these optionsto the commands in the session.

OptionTypeDescription
lsidDocumentThe document that specifies the unique id of the sessionassociated with the command. If the txnNumber isspecified, the lsid is required.
txnNumber64-bit integerA strictly increasing non-negative number that uniquelyidentifies the command in the command’s session.If specified, the command must also include the lsidoption.

For the delete, insert, and updatecommands that take an array of statements, the following option is alsoavailable:

Important

Do not manually set stmtIds. MongoDB sets the stmtIdsto be strictly increasing non-negative numbers.

OptionTypeDescription
stmtIdsArray of 32-bit integersArray of numbers that uniquely identify their respectivewrite operations within the write command.

JSON Schema

MongoDB 3.6 adds the $jsonSchema operator to supportdocument validation using JSONSchema. For details, see $jsonSchema.

To use $jsonSchema, featureCompatibilityVersion must beset to “3.6”.

See also

Backwards Incompatible Features

Replica Sets

Sharded Clusters

  • Starting in 3.6, shards must be replica sets. To upgrade your shardedcluster to version 3.6, the shard servers must be running as areplica set.

To convert an existing shard standalone instance to a shard replicaset, see Convert a Shard Standalone to a Shard Replica Set.

  • Starting in 3.6, all members of a shard replica set, not just theprimary, maintain the metadata regarding chunk metadata. Thisprevents reads from the secondaries from returning orphaneddata when not using "available"read concern.

  • Added ShardingTaskExecutorPoolMaxConnecting parameterfor mongos to control the rate at which mongosadds connections to a mongod instance.

  • Added orphanCleanupDelaySecs that determines the minimumdelay before a migrated chunk is deleted from the source shard.

  • The config.system.sessions collection in the config databasemay now be sharded.

General Enhancements

MongoDB Compass Packaging

The MongoDB Server download is packaged with a platform-specificinstallation script forMongoDB Compass Community Edition. Thisscript installs MongoDB Compass as part of the MongoDB Serverinstallation process.

Collection Identifier

Collections have an immutable unique identifier. The featureCompatibilityVersion must be setto "3.6".

See also

Backwards Incompatible Features

New Query Operators

MongoDB 3.6 adds the following new query operators:

  • The new $jsonSchema operator matches documents that validateagainst the given JSON Schema. To use $jsonSchema,featureCompatibilityVersion must be set to “3.6”.
  • The $expr allows the use of aggregation expressions withinthe query language.

See also

Backwards Incompatible Features

Removed Operators

MongoDB 3.6 removes the deprecated $pushAll update operator. For moreinformation, see Remove $pushAll Update Operator.

Indexes

  • An index can cover a query on fields within nested documents.
  • Multikey indexes can cover queries over non-array keys if the indextracks which fields make it multikey.
  • When creating an index, you cannot specify as the name of theindex. See [Indexes Named ]($8d766be795784050.md#index-asterisk).

Commands

  • Added the following options to the listDatabases command:
    • nameOnly to return only the database names (whichdoes not require database locks) instead of returning both thedatabase names and size information (which does require databaselocks).
    • filter to return databases that match thespecified match criteria on the outputs.
  • Modified behavior of the validate command and thedb.collection.validate() method such that only for fullvalidation does the WiredTiger storage engine force a checkpoint,flush all in-memory data to disk, then verify the on-disk data. Seealso validate Operation.
  • The <database>.system.profile entry for update anddelete contains the entire update/delete document appliedto the named collection.
  • dropDatabase waits until all collections drops in thedatabase have propagated to a majority of the replica set members.
  • For commands run on replica sets and sharded clusters, the responsedocuments include the operationTime and $clusterTime. Seedb.runCommand and db.adminCommand.
  • Deprecated getPrevError command.

Wire Protocol and Compression

  • MongoDB 3.6 introduces a new wire protocol opcode called OP_MSG.This opcode’s message format is extensible and designed to subsumethe functionality of other opcodes.
  • MongoDB 3.6 adds support for the zlib compressor for—networkMessageCompressors option (ornet.compression.compressors setting if using theconfiguration file). —networkMessageCompressors option (ornet.compression.compressors setting) enables networkcompression for communication among mongod,mongos, mongo shell, and drivers thatsupport the OP_COMPRESSED message format.
  • mongod and mongos enable networkcompression by default with snappy as the compressor. For moreinformation on network compression, seenet.compression.compressors.

Read Concern

  • New "available" read concern is available. Forunsharded collections (including collections in a standalonedeployment or a replica set deployment), "local" and"available" read concerns behave identically. Forsharded clusters, "available" provides greatertolerance for partitions but may return orphan documents if the shardis undergoing chunk migrations.

See also

orphanCleanupDelaySecs

  • Starting in MongoDB 3.6, MongoDB enables support for“majority” read concern bydefault.

For MongoDB 3.6.1 - 3.6.x, you can disable read concern“majority” to prevent thestorage cache pressure from immobilizing a deployment with aprimary-secondary-arbiter (PSA) architecture. Disabling“majority” read concernalso disables support for change streams

For more information, see Disable Read Concern Majority.

FTDC

MongoDB 3.6 adds support for Diagnostics Capture (also known as FTDC) inmongos. [1] In previous versions, the feature is available formongod only. See Diagnostic Parameters.

Note

FTDC is enabled by default.

[1]MongoDB 3.4.14+ also adds mongos support for FTDC.

Additional Enhancements

MongoDB 3.6 includes the following enhancements:

  • Added support for specifying full Unix domain socket paths with—bind_ip.
  • mongod now offers a —timeZoneInfo option. Use thisoption to specify the path to your system time zone database. The defaultconfiguration file included with Linux and macOS packages sets this to/usr/share/zoneinfo.
  • Date operations now accept consistent date ranges across all supportedoperating systems. You may safely work with years in the range 0through 9999.
  • The new honorSystemUmask startup option formongod causes new files created by MongoDB to havethe read/write permissions specified by the umask of the user who runs themongod process. Only available on Linux and macOS systems.
  • The maxWriteBatchSize limitof a database, which indicates the maximum number of write operationspermitted in a write batch, raises from 1,000 to 100,000.
  • The planCacheListPlans database command produces the sameoutput as the PlanCache.getPlansByQuery() shell method. Theoutput from both operations now includes a timestamp for whenthe plans were generated.
  • The new KeysRotationIntervalSec server parameterspecifies the number of seconds for which an HMAC signing keyis valid before rotating to the next one.
  • The find command’s option oplogReplay nowsupports the $eq operator.

Changes Affecting Compatibility

Some changes can affect compatibility and may require user actions. Fora detailed list of compatibility changes, seeCompatibility Changes in MongoDB 3.6.

Upgrade Procedures

Feature Compatibility Version 3.4

To upgrade, the 3.4 instances must havefeatureCompatibilityVersion set to 3.4. To check the version:

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

For specific details on verifying and setting thefeatureCompatibilityVersion as well as information on otherprerequisites/considerations for upgrades, refer to the individualupgrade instructions:

If you need guidance on upgrading to 3.6, MongoDB offers major versionupgrade servicesto help ensure a smooth transition without interruption to your MongoDB application.

Download

To download the MongoDB 3.6, go to the MongoDBDownload Center

See also

Known Issues in 3.6.3

    • WT-3724:
    • MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13and may encounter errors.
  • Operations that build in-memory structures are not causallyconsistent; however, only some operations return errors whenassociated with causally consistent sessions. See CausalConsistency Limitations.

Known Issues in 3.6.2

    • SERVER-31760:
    • $expr does not use indexes for equality match againstfield, including when used as part of a $lookupaggregation stage with foreign pipeline.
    • WT-3724:
    • MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13and may encounter errors.
  • Operations that build in-memory structures are not causallyconsistent; however, only some operations return errors whenassociated with causally consistent sessions. See CausalConsistency Limitations.

Known Issues in 3.6.1

    • SERVER-31760:
    • $expr does not use indexes for equality match againstfield, including when used as part of a $lookupaggregation stage with foreign pipeline.
    • WT-3724:
    • MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13and may encounter errors.
  • Operations that build in-memory structures are not causallyconsistent; however, only some operations return errors whenassociated with causally consistent sessions. See CausalConsistency Limitations.

Known Issues in 3.6.0

    • SERVER-31760:
    • $expr does not use indexes for equality match againstfield, including when used as part of a $lookupaggregation stage with foreign pipeline.
    • TOOLS-1827:
    • When using a URI with SRV, fetched TXT records will be ignored ifno query parameters are specified in the command line URI. To getaround this, explicitly specify the TLS/SSL setting used tocommunicate with the database (either ssl=true or ssl=false) inthe URI query string.
    • WT-3724:
    • MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13and may encounter errors.
  • Operations that build in-memory structures are not causallyconsistent; however, only some operations return errors whenassociated with causally consistent sessions. See CausalConsistency Limitations.

See also

All JIRA issues resolved in 3.6.

Report an Issue

To report an issue, seehttps://github.com/mongodb/mongo/wiki/Submit-Bug-Reports forinstructions on how to file a JIRA ticket for the MongoDB server or oneof the related projects.