- Release Notes >
- Release Notes for MongoDB 3.6
Release Notes for MongoDB 3.6¶
On this page
- Minor Releases
- Security
- Aggregation
- Array Update Operator Enhancements
- 3.6 Compatible Drivers
- Change Streams
- Client Sessions
- Server Sessions
- JSON Schema
- Replica Sets
- Sharded Clusters
- General Enhancements
- Changes Affecting Compatibility
- Upgrade Procedures
- Download
- Known Issues in 3.6.3
- Known Issues in 3.6.2
- Known Issues in 3.6.1
- Known Issues in 3.6.0
- Report an Issue
Minor Releases¶
3.6.8 - Sep 19, 2018¶
Issues fixed:
- SERVER-34204: Tailable cursor fails on getMore against a sharded cluster.
- SERVER-34846: Covered index with collated field returns incorrect result when collation not involved in match or sort.
- SERVER-37002: Dropping a collection with long index names via rename fails under MMAPv1.
- SERVER-36149: Fix privileges on setFCV virtual namespace.
- All JIRA issues closed in 3.6.8
- 3.6.8 Changelog
3.6.7 - Aug 25, 2018¶
Issues fixed:
- SERVER-27725: Use batch insert when migrating chunks
- SERVER-36070: Aggregation with $out results in error when Auditing is enabled
- TOOLS-2075: mongoreplay always replays to secondary
- All JIRA issues closed in 3.6.7
- 3.6.7 Changelog
3.6.6 - Jul 10, 2018¶
Issues fixed:
- SERVER-33538:
mapReduce“replace” on a sharded output collection can lead to UUIDCatalog inconsistencies. - SERVER-32999: Platform Support: Remove Debian 7 builds.
- SERVER-5461 Add
syncSourceHostfield toreplSetGetStatusoutput. - All JIRA issues closed in 3.6.6
- 3.6.6 Changelog
3.6.5 - May 29, 2018¶
Issues fixed:
- SERVER-34746: Segmentation fault when shard is started with
--shardsvrbefore being added to a shard. - SERVER-34423: collMod interruption may cause invariant failure.
- SERVER-34390: MongoDB binaries for macOS support TLS 1.2.
- SERVER-29463: Platform Support: add Debian 9 “stretch”.
- SERVER-34399: $changeStream with invalid resume token crashes the server.
- SERVER-29301: Upgrade MozJS to ESR 45.9.0.
- All JIRA issues closed in 3.6.5
- 3.6.5 Changelog
3.6.4 - Apr 13, 2018¶
Issues fixed:
- SERVER-28670: Add sharding metadata refresh metrics section to serverStatus.
- SERVER-32677: Segmentation fault converting ReplicaSet to Replicated Shard Cluster.
- SERVER-33763: 3.6 drivers fail to communicate with 3.6 sharded clusters running at FCV 3.4.
- SERVER-32923: Remove SLES11 support.
- SERVER-31535: Remove Ubuntu 12.04 support.
- SERVER-32498:
currentOpoutput no longer returnsthreadIdfield. - All JIRA issues closed in 3.6.4
- 3.6.4 Changelog
3.6.3 - February 23, 2018¶
Issues fixed:
- SERVER-32441: 3.6
mongodcrash on find with index and nested$and/$or. - SERVER-32606: Tailing oplog on secondary fails with CappedPositionLost
- SERVER-32631: specifying
--bind_iplocalhost results in error “address already in use” - All JIRA issues closed in 3.6.3
- 3.6.3 Changelog
3.6.2 - January 10, 2018¶
Issues fixed:
- SERVER-31267: CollectionCloner fails if collection is dropped between getMore calls.
- SERVER-31625: The contents of
Unknown macro: {USER}needs to be escaped when querying for the groups using LDAP server. - SERVER-31684: QueryPlanKilled (operation exceeded time limit) in $changeStream with updateLookup.
- SERVER-31982: Shard does not call config commit chunk migration command with majority writeConcern nor checks for writeConcern errors..
- SERVER-32246: PID file permission on v3.6 make it not monitorable using pid file.
- SERVER-32255: UUIDs may be absent from shard secondary local collections.
- SERVER-32282: Aggregation text search returns text score even if it wasn’t requested when targeting multiple shards in a sharded cluster.
- SERVER-32396
mongoshell failed to connect with 3.6 connection string SRV - SERVER-32430: DocumentSourceSort sorts array documents incorrectly if there is a non-simple collation.
- SERVER-32529: Requiring replSet for shards breaks Queryable Backup.
- All JIRA issues closed in 3.6.2
- 3.6.2 Changelog
3.6.1 - Dec 26, 2017¶
Issues fixed:
- SERVER-30768: Primary queries using maxTimeMS cause temporary shard write unavailability if ExceededTimeLimit.
- SERVER-31225: The
mongodprocess forks before listening for connections. - SERVER-31885: changeStream cursor is not returned on a
mongoswhen the database does not exist. - SERVER-32085: changeStream reports incorrect documentKey for unsharded collections that become sharded.
- SERVER-32046: Arrays of certain NumberDecimals can trigger an invariant failure.
- SERVER-32048: Updates using a numeric path component may cause index entries not to be created.
- All JIRA issues closed in 3.6.1
- 3.6.1 Changelog
Security¶
Default Bind to Localhost¶
Starting with MongoDB 3.6, MongoDB binaries, mongod and
mongos, bind to localhost by default.
From MongoDB versions 2.6 to 3.4, only the binaries from the
official MongoDB RPM (Red Hat, CentOS, Fedora Linux, and derivatives)
and DEB (Debian, Ubuntu, and derivatives) packages would bind to
localhost by default. To learn more about this change, see
Localhost Binding Compatibility Changes.
MONGODB-CR Deprecation¶
As of MongoDB 3.6, MONGODB-CR authentication mechanism is
deprecated. If you have not upgraded your MONGODB-CR authentication
schema to SCRAM, see Upgrade to SCRAM.
Authentication Restrictions¶
To restrict database user connections to specified IP addresses, added
authenticationRestrictions parameter to the following:
| Commands | Methods |
|---|---|
createUser |
db.createUser() |
updateUser |
db.updateUser() |
createRole |
db.createRole() |
updateRole |
db.updateRole() |
Additional Security Enhancements¶
Added the
opensslCipherConfigparameter to control the OpenSSL ciphers when using TLS/SSL encryption.If authentication is turned on, you can only issue a
getMoreagainst cursors you created.Added the
convertToCappedaction torestorerole.See also
Aggregation¶
The following features are available starting in MongoDB 3.6.
More Expressive $lookup¶
$lookup adds support for specifying multiple join
conditions as well as uncorrelated sub-queries by allowing variable
specification and pipeline execution on the joined collection.
For details, see the $lookup syntax for
Join Conditions and Uncorrelated Sub-queries.
New Aggregation Stages¶
MongoDB 3.6 adds the following new aggregation pipeline stages:
| Operator | Description |
|---|---|
$currentOp |
Returns a stream of documents containing information
on active and/or dormant operations on a mongod
instance. Uses the new aggregation helper
db.aggregate(). |
$listSessions |
Lists server sessions in the system.sessions collection in the
config database. Uses the new aggregation helper
db.aggregate(). |
$listLocalSessions |
Lists server sessions cached in memory by the server. |
New Aggregation Operators¶
| Operator | Description |
|---|---|
$arrayToObject |
Converts an array of key value pairs to a document. |
$objectToArray |
Converts a document to an array of documents representing key-value pairs. |
$mergeObjects |
Combines multiple documents into a single document. |
$dateFromString |
Converts a date/time string to a date object. |
$dateFromParts |
Constructs a BSON Date object given the date’s constituent parts. |
$dateToParts |
Returns a document containing the constituent parts of a date. |
New Aggregation Helper¶
MongoDB 3.6 adds a helper, db.aggregate(), to perform
aggregations that do not rely on an underlying collection, such
as those that start with $currentOp or
$listLocalSessions.
New Options¶
aggregate command and the
db.collection.aggregate() method support the following new options:
hintoption to specify the index to use.Note
The
hintdoes not apply to$lookupand$graphLookupstages.commentoption to help trace the operation through the database profiler, currentOp, and logs.
Support for Time Zones¶
MongoDB 3.6 adds support for time zones to aggregation date operators.
See also
Array Update Operator Enhancements¶
arrayFilters¶
The following commands and methods can accept an arrayFilters
parameter to specify which elements to modify in an array field:
| Commands | Methods |
|---|---|
findAndModify |
|
update |
|
|
|
Multi-Element Array Updates¶
MongoDB 3.6 adds the following new positional operators for update operations on arrays and nested arrays:
- The all positional
$[]operator updates all elements in an array. - The filtered positional
$[<identifier>]operator updates all elements in an array that match the arrayFilters criteria.
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 support a DNS-constructed seedlist. For more information, see DNS Seedlist Connection Format.
Change Streams¶
MongoDB 3.6 supports opening change streams against replica sets and sharded clusters with replica set shards.
Change streams allow applications to access real-time data changes without the complexity and risk of tailing the oplog. Applications can use change streams to subscribe to all data changes on a collection and respond to those changes.
You can open a change stream from any 3.6-series driver using the
db.collection.watch() method. See the documentation for
your 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 and
setFeatureCompatibilityVersion.
Client Sessions¶
Causal Consistency¶
To provide causal consistency, MongoDB 3.6 enables causal consistency in client sessions. A causally consistent client session denotes that the associated sequence of read and acknowledged write operations have a causal relationship that is reflected by their ordering. Client applications must ensure that only one thread at a time executes these operations in a client session.
Applications can start a client session and associate operations with a specific session. Applications must ensure that only one thread at a time executes these operations in a client session.
Important
To use client sessions:
- Clients require MongoDB drivers updated for MongoDB 3.6.
featureCompatibilityVersionmust be “3.6”. For more information, see View FeatureCompatibilityVersion andsetFeatureCompatibilityVersion.
Retryable Writes¶
Important
For retryable writes:
- Clients require MongoDB drivers updated for MongoDB 3.6.
featureCompatibilityVersionmust be “3.6”. For more information, see View FeatureCompatibilityVersion andsetFeatureCompatibilityVersion.
Starting in MongoDB 3.6, certain acknowledged write operations on replica sets and sharded clusters are “retryable” to provide handling of transient network errors or replica set elections.
With retryable writes, MongoDB drivers automatically retries these
operations upon encountering network errors or encountering a
replica set failover during which
time the replica set has no primary. To enable retryable writes for the
3.6 drivers, see retryWrites.
As the retry attempt is made only once, the retryable feature can help address 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 to
the mongo shell. The option enables
Retryable Writes in the
mongo shell.
The following new methods have been added to the Mongo() connection
object in the mongo shell:
Mongo.isCausalConsistency()Mongo.startSession()- Various
Sessionmethods - Various
SessionOptionsmethods
Server Sessions¶
MongoDB’s server sessions, or logical sessions, are the underlying framework used by client sessions to support Causal Consistency and retryable writes.
Important
Applications use client sessions to interface with server sessions.
Server sessions are available for standalone mongod
instances, replica sets, and sharded clusters.
Server Session Commands¶
Starting in 3.6, MongoDB drivers associate all operations with a server session, with the exception of unacknowledged writes. If the deployment enforces authentication/authorization, server sessions are associated with the authenticated users.
The following commands can be used to list, manage, and kill server sessions throughout MongoDB clusters:
| Commands | Descriptions |
|---|---|
endSessions |
Expires specified server sessions. |
killAllSessions |
Kills all server sessions. |
killAllSessionsByPattern |
Kills all server sessions that match the specified pattern. |
killSessions |
Kills specified server sessions. |
refreshSessions |
Refreshes idle server sessions. |
startSession |
Starts 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 new aggregation pipeline stages:
| Operator | Description |
|---|---|
$listSessions |
Lists the server sessions in the system.sessions collection in the
config database. |
$listLocalSessions |
Lists the server sessions cached in memory by the server. Uses
the new aggregation helper db.aggregate(). |
General¶
serverStatus returns information on the number of
logicalSessionRecordCache.
Command Options¶
Starting in 3.6, MongoDB drivers associate all operations with a server session, with the exception of unacknowledged writes. The following options are available for all commands to support association with a server session:
Important
The mongo shell and the drivers assign these options
to the commands in the session.
| Option | Type | Description |
|---|---|---|
lsid |
Document | The document that specifies the unique id of the session
associated with the command. If the txnNumber is
specified, the lsid is required. |
txnNumber |
64-bit integer | A strictly increasing non-negative number that uniquely identifies the command in the command’s session. If specified, the command must also include the |
For the delete, insert, and update
commands that take an array of statements, the following option is also
available:
Important
Do not manually set stmtIds. MongoDB sets the stmtIds
to be strictly increasing non-negative numbers.
| Option | Type | Description |
|---|---|---|
stmtIds |
Array of 32-bit integers | Array of numbers that uniquely identify their respective write operations within the write command. |
JSON Schema¶
MongoDB 3.6 adds the $jsonSchema operator to support
document validation using JSON
Schema. For details, see $jsonSchema.
To use $jsonSchema, featureCompatibilityVersion must be
set to “3.6”.
See also
Replica Sets¶
- Deprecate replica set protocol version 0 (
pv0). For more information on the replica set protocol versions, see Replica Set Protocol Version. - Added the
replSetResizeOplogcommand to dynamically resize a replica set member’s oplog. Available for instances running the WiredTiger storage engine. - Added the catchUpTakeoverDelayMillis configuration option, dictating the amount of time a node waits to run for election after determining that it is ahead of the current primary.
- For replica sets that use the protocol version 1 (
pv1), arbiters will vote no in elections if they detect a healthy primary of equal or greater priority to the candidate. For more information on replica set protocol versions, see Replica Set Protocol Version. - Added the
oplogInitialFindMaxSecondsparameter to adjust how long a member of a replica set should wait for itsfindcommand to finish during data synchronization. - Added the
waitForSecondaryBeforeNoopWriteMSparameter to specify how long a secondary must wait if theafterClusterTimeis greater than the last applied time from the oplog. - Added support for running the following during a replica set member’s
initial sync:
renameCollectionconvertToCapped$outstages in aggregation pipelines- Map-reduce jobs that output to a new collection
Sharded Clusters¶
Starting in 3.6, shards must be replica sets. To upgrade your sharded cluster to version 3.6, the shard servers must be running as a replica set.
To convert an existing shard standalone instance to a shard replica set, see Convert a Standalone to a Replica Set.
Added
ShardingTaskExecutorPoolMaxConnectingparameter formongosto control the rate at whichmongosadds connections to amongodinstance.Added
orphanCleanupDelaySecsthat determines the minimum delay before a migrated chunk is deleted from the source shard.The
config.system.sessionscollection in theconfigdatabase may now be sharded.
General Enhancements¶
MongoDB Compass Packaging¶
The MongoDB Server download is packaged with a platform-specific installation script for MongoDB Compass Community Edition. This script installs MongoDB Compass as part of the MongoDB Server installation process.
Collection Identifier¶
Collections have an immutable unique identifier. The featureCompatibilityVersion must be set
to "3.6".
See also
New Query Operators¶
MongoDB 3.6 adds the following new query operators:
- The new
$jsonSchemaoperator matches documents that validate against the given JSON Schema. To use$jsonSchema,featureCompatibilityVersionmust be set to “3.6”. - The
$exprallows the use of aggregation expressions within the query language.
See also
Removed Operators¶
MongoDB 3.6 removes the deprecated $pushAll update operator. For more
information, 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 index tracks which fields make it multikey.
- When creating an index, you cannot specify
*as the name of the index. See Indexes Named *.
Commands¶
- Added the following options to the
listDatabasescommand:nameOnlyto return only the database names (which does not require database locks) instead of returning both the database names and size information (which does require database locks).filterto return databases that match the specified match criteria on the outputs.
- Modified behavior of the
validatecommand and thedb.collection.validate()method such that only forfullvalidation does the WiredTiger storage engine force a checkpoint, flush all in-memory data to disk, then verify the on-disk data. See also validate Operation. - The
<database>.system.profileentry forupdateanddeletecontains the entire update/delete document applied to the named collection. dropDatabasewaits until all collections drops in the database have propagated to a majority of the replica set members.- For commands run on replica sets and sharded clusters, the response
documents include the
operationTimeand$clusterTime. Seedb.runCommandanddb.adminCommand. - Deprecated
getPrevErrorcommand.
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 subsume the functionality of other opcodes.
- Added support for the
zlibcompressor for--networkMessageCompressorsoption (ornet.compression.compressorssetting if using the configuration file).--networkMessageCompressorsoption (ornet.compression.compressorssetting) enables network compression for communication amongmongod,mongos,mongoshell, and drivers that support theOP_COMPRESSEDmessage format. - Enables
snappynetwork compression for communication, by default, amongmongod,mongos, andmongoshell.
Read Concern¶
New
"available"read concern is available. For unsharded collections (including collections in a standalone deployment or a replica set deployment),"local"and"available"read concerns behave identically. For sharded clusters,"available"provides greater tolerance for partitions but may return orphan documents if the shard is undergoing chunk migrations.See also
"majority"read concern is always enabled and deprecates/obsoletes the use of--enableMajorityReadConcernandreplication.enableMajorityReadConcern.
FTDC¶
MongoDB 3.6 adds support for Diagnostics Capture (also known as FTDC) in
mongos. [1] In previous versions, the feature is available for
mongod 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. mongodnow offers a--timeZoneInfooption. Use this option to specify the path to your system time zone database. The default configuration file included with Linux and macOS packages sets this to/usr/share/zoneinfo.- Date operations now accept consistent date ranges across all supported
operating systems. You may safely work with years in the range
0through9999. - The new
honorSystemUmaskstartup option formongodcauses new files created by MongoDB to have the read/write permissions specified by the umask of the user who runs themongodprocess. Only available on Linux and macOS systems. - The
maxWriteBatchSizelimit of a database, which indicates the maximum number of write operations permitted in a write batch, raises from1,000to100,000. - The
planCacheListPlansdatabase command produces the same output as thePlanCache.getPlansByQuery()shell method. The output from both operations now includes a timestamp for when the plans were generated. - The new
KeysRotationIntervalSecserver parameter specifies the number of seconds for which an HMAC signing key is valid before rotating to the next one. - The
findcommand’s optionoplogReplaynow supports the$eqoperator.
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 3.6.
Upgrade Procedures¶
Feature Compatibility Version 3.4
To upgrade, the 3.4 instances must have
featureCompatibilityVersion set to 3.4. To check the version:
For specific details on verifying and setting the
featureCompatibilityVersion as well as information on other
prerequisites/considerations for upgrades, refer to the individual
upgrade instructions:
If you need guidance on upgrading to 3.6, MongoDB offers major version upgrade services to help ensure a smooth transition without interruption to your MongoDB application.
Known Issues in 3.6.3¶
- WT-3724:
- MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13 and may encounter errors.
- Operations that build in-memory structures are not causally consistent; however, only some operations return errors when associated with causally consistent sessions. See Causal Consistency Limitations.
Known Issues in 3.6.2¶
- SERVER-31760:
$exprdoes not use indexes for equality match against field, 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.13 and may encounter errors.
- Operations that build in-memory structures are not causally consistent; however, only some operations return errors when associated with causally consistent sessions. See Causal Consistency Limitations.
Known Issues in 3.6.1¶
- SERVER-31760:
$exprdoes not use indexes for equality match against field, 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.13 and may encounter errors.
- Operations that build in-memory structures are not causally consistent; however, only some operations return errors when associated with causally consistent sessions. See Causal Consistency Limitations.
Known Issues in 3.6.0¶
- SERVER-31760:
$exprdoes not use indexes for equality match against field, 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 if no query parameters are specified in the command line URI. To get around this, explicitly specify the TLS/SSL setting used to communicate with the database (either ssl=true or ssl=false) in the URI query string.
- WT-3724:
- MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13 and may encounter errors.
- Operations that build in-memory structures are not causally consistent; however, only some operations return errors when associated with causally consistent sessions. See Causal Consistency Limitations.
See also
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.