On this page本页内容
Issues Fixed:
Issues Fixed:
Issues Fixed:
Issues fixed:
Note
Fixed issues include those that resolve the following Common Vulnerabilities and Exposure (CVE):
Issues fixed:
Issues fixed:
Issues fixed:
Issues fixed:
Note
Fixed issues include those that resolve the following Common Vulnerabilities and Exposures (CVEs):
Issues fixed:
Note
Fixed issues include those that resolve the following Common Vulnerabilities and Exposures (CVEs):
Issues fixed:
Issues fixed:
Issues fixed:
tuneable batch size for chunk migrationstuneable batch size for the rangedeleterIssues fixed:
Issues fixed:
Issues fixed:
Issues fixed:
mapReduce “replace” on a sharded output collection can lead to UUIDCatalog inconsistencies.syncSourceHost field to replSetGetStatus output.Issues fixed:
--shardsvr before being added to a shard.Issues fixed:
currentOp output no longer returns threadId field.Issues fixed:
mongod crash on find with index and nested $and/$or.--bind_ip localhost results in error “address already in use”Issues fixed:
Unknown macro: {USER} needs to be escaped when querying for the groups using LDAP server.mongo shell failed to connect with 3.6 connection string SRVIssues fixed:
mongod process forks before listening for connections.mongos when the database does not exist.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.
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() |
opensslCipherConfig parameter to control the OpenSSL ciphers when using TLS/SSL encryption.getMore against cursors you created.convertToCapped action to restore role.
See also参阅
The following features are available starting in MongoDB 3.6.
$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.
MongoDB 3.6 adds the following new aggregation pipeline stages:
| Operator | |
|---|---|
$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. |
| Operator | |
|---|---|
$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. |
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.
aggregate command and the db.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 database profiler, currentOp, and logs.MongoDB 3.6 adds support for time zones to aggregation date operators.
See also参阅
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 |
|
|
|
MongoDB 3.6 adds the following new positional operators for update operations on arrays and nested arrays:
$[] operator updates all elements in an array.$[<identifier>] operator updates all elements in an array that match the arrayFilters criteria.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+ |
mongodb+srv¶In addition to the standard connection format, the 3.6 drivers support a DNS-constructed seedlist. For more information, see DNS Seed List Connection Format.
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.
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:
featureCompatibilityVersion must be “3.6”. For more information, see View FeatureCompatibilityVersion and setFeatureCompatibilityVersion.Important
For retryable writes:
featureCompatibilityVersion must be “3.6”. For more information, see View FeatureCompatibilityVersion and setFeatureCompatibilityVersion.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()Session methodsSessionOptions methodsMongoDB’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.
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. |
The following new parameters are available for server sessions:
logicalSessionRefreshMinuteslocalLogicalSessionTimeoutMinutesmaxAcceptableLogicalClockDriftSecsTo support server sessions, MongoDB 3.6 adds the following new aggregation pipeline stages:
| Operator | |
|---|---|
$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(). |
serverStatus returns information on the number of logicalSessionRecordCache.
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 | ||
|---|---|---|
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 | ||
|---|---|---|
stmtIds |
Array of 32-bit integers | Array of numbers that uniquely identify their respective write operations within the write command. |
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参阅
pv0). For more information on the replica set protocol versions, see Replica Set Protocol Version.replSetResizeOplog command to dynamically resize a replica set member’s oplog. Available for instances running the WiredTiger storage engine.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.oplogInitialFindMaxSeconds parameter to adjust how long a member of a replica set should wait for its find command to finish during data synchronization.waitForSecondaryBeforeNoopWriteMS parameter to specify how long a secondary must wait if the afterClusterTime is greater than the last applied time from the oplog.renameCollectionconvertToCapped$out stages in aggregation pipelinesTo convert an existing shard standalone instance to a shard replica set, see Convert a Shard Standalone to a Shard Replica Set.
"available" read concern.ShardingTaskExecutorPoolMaxConnecting parameter for mongos to control the rate at which mongos adds connections to a mongod instance.orphanCleanupDelaySecs that determines the minimum delay before a migrated chunk is deleted from the source shard.config.system.sessions collection in the config database may now be sharded.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.
Collections have an immutable unique identifier. The featureCompatibilityVersion must be set to "3.6".
See also参阅
MongoDB 3.6 adds the following new query operators:
$jsonSchema operator matches documents that validate against the given JSON Schema. To use $jsonSchema, featureCompatibilityVersion must be set to “3.6”.$expr allows the use of aggregation expressions within the query language.See also参阅
MongoDB 3.6 removes the deprecated $pushAll update operator. For more information, see Remove $pushAll Update Operator.
* as the name of the index. See Indexes Named *.listDatabases command:nameOnly to 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).filter to return databases that match the specified match criteria on the outputs.validate command and the db.collection.validate() method such that only for full validation 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.<database>.system.profile entry for update and delete contains the entire update/delete document applied to the named collection.dropDatabase waits until all collections drops in the database have propagated to a majority of the replica set members.operationTime and $clusterTime. See db.runCommand and db.adminCommand.zlib compressor for --networkMessageCompressors option (or net.compression.compressors setting if using the configuration file). --networkMessageCompressors option (or net.compression.compressors setting) enables network compression for communication among mongod, mongos, mongo shell, and drivers that support the OP_COMPRESSED message format.mongod and mongos enable network compression by default with snappy as the compressor. For more information on network compression, see net.compression.compressors."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参阅
For MongoDB 3.6.1 - 3.6.x, you can disable read concern “majority” to prevent the storage cache pressure from immobilizing a deployment with a primary-secondary-arbiter (PSA) architecture. Disabling “majority” read concern also disables support for change streams
For more information, see Disable Read Concern Majority.
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. |
MongoDB 3.6 includes the following enhancements:
--bind_ip.mongod now offers a --timeZoneInfo option. 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.0 through 9999.honorSystemUmask startup option for mongod causes new files created by MongoDB to have the read/write permissions specified by the umask of the user who runs the mongod process. Only available on Linux and macOS systems.maxWriteBatchSize limit of a database, which indicates the maximum number of write operations permitted in a write batch, raises from 1,000 to 100,000.planCacheListPlans database command produces the same output as the PlanCache.getPlansByQuery() shell method. The output from both operations now includes a timestamp for when the plans were generated.KeysRotationIntervalSec server parameter specifies the number of seconds for which an HMAC signing key is valid before rotating to the next one.find command’s option oplogReplay now supports the $eq operator.Some changes can affect compatibility and may require user actions. For a detailed list of compatibility changes, see Compatibility Changes in MongoDB 3.6.
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.
$expr does not use indexes for equality match against field, including when used as part of a $lookup aggregation stage with foreign pipeline.$expr does not use indexes for equality match against field, including when used as part of a $lookup aggregation stage with foreign pipeline.$expr does not use indexes for equality match against field, including when used as part of a $lookup aggregation stage with foreign pipeline.See also参阅
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.