============================= Release Notes for MongoDB 3.4 ============================= .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 1 :class: twocols .. admonition:: MongoDB 3.4 Released Nov 29, 2016 MongoDB 3.4 is now available. Key features include linearizable read concerns, views, and collation. OpsManager 3.4 is also available. See the `Ops Manager documentation `_ and the `Ops Manager release notes `_ for more information. Minor Releases -------------- .. class:: hidden .. toctree:: /release-notes/3.4-changelog .. _3.4.24-release-notes: 3.4.24 - Jan 27, 2020 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-37772`: Platform Support: Add Community & Enterprise RHEL 8 x64 - :issue:`SERVER-37135`: TLSVersionCounts needs to track and report TLS 1.3 - :issue:`SERVER-36315`: After stepdown the CSRS dist lock manager keeps trying to unlock locks - :issue:`SERVER-37846`: writeConcern can be satisfied with an arbiter if the write was committed - :issue:`SERVER-38945`: SSL performance regression - :issue:`SERVER-40355`: rs.config that contains an _id greater than the number of nodes will crash - :issue:`SERVER-43151`: Error in aggregation assertion at value.cpp:1368 - :issue:`SERVER-44050`: Arrays along 'hashed' index key path are not correctly rejected - :issue:`WT-4956`: Handle the case where 4 billion updates are made to a page without eviction - :ref:`3.4.24-changelog` - `All JIRA issues closed in 3.4.24 `_ .. _3.4.23-release-notes: 3.4.23 - Sep 16, 2019 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-36394`: mongos should reset chunk size tracking information when autosplit = false or splitvector returns too few split points - :issue:`SERVER-41829`: findAndModify ignores filter expressions that are not objects - :issue:`SERVER-42055`: Only acquire a collection IX lock to write the lastVote document - :ref:`3.4.23-changelog` - `All JIRA issues closed in 3.4.23 `_ .. _3.4.22-release-notes: 3.4.22 - Aug 6, 2019 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-17010`: Reduce file handle usage in File based Sorter. - :issue:`SERVER-38984`: Attach IDs to users (CVE-2019-2386). - :issue:`SERVER-42089`: Platform Support: Remove Enterprise RHEL 6.7 zSeries - :ref:`3.4.22-changelog` - `All JIRA issues closed in 3.4.22 `_ .. note:: Fixed issues include those that resolve the following Common Vulnerabilities and Exposures (CVEs): - CVE-2019-2386 (See :issue:`SERVER-38984`) - CVE-2019-2389 (See :issue:`SERVER-40563`) - CVE-2019-2390 (See :issue:`SERVER-42233`) .. _3.4.21-release-notes: 3.4.21 - Jun 14, 2019 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-39820`: Add the client IP address to the successful authentication log message - :issue:`SERVER-41213`: Unique background index builds may produce inconsistent keys - :issue:`SERVER-37765`: Platform Support: Remove Ubuntu 14.04 - :issue:`SERVER-37774`: Platform Support: Remove Enterprise Ubuntu 16.04 PPCLE - :issue:`WT-4615`: Sync backup file before returning backup cursor - :ref:`3.4.21-changelog` - `All JIRA issues closed in 3.4.21 `_ .. _3.4.20-release-notes: 3.4.20 - Mar 13, 2019 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-39166`: $graphLookup should force a pipeline to split in sharded cluster - :issue:`SERVER-39723`: Change listIndexes command behavior to show in-progress index builds - :issue:`TOOLS-2158`: mongodump failing on Windows with "error opening system CA store: Access is denied." - :ref:`3.4.20-changelog` - `All JIRA issues closed in 3.4.20 `_ .. _3.4.19-release-notes: 3.4.19 - Jan 28, 2019 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-18985`: setParameter should log at level 0 - :issue:`SERVER-22766`: Dynamic oplog sizing for WiredTiger nodes - :issue:`SERVER-33469`: Make syslog log lines consistent with mongod log lines - :issue:`SERVER-37132`: Negation of $in with regex can incorrectly plan from the cache, leading to missing query results - :issue:`SERVER-37182`: Different values when referencing whole object vs. a field of that object after $arrayToObject - :issue:`SERVER-37616`: Implement tuneable batch size for the rangedeleter - :ref:`3.4.19-changelog` - `All JIRA issues closed in 3.4.19 `_ .. _3.4.18-release-notes: 3.4.18 - Nov 7, 2018 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-25175`: listIndexes shouldn't include in-progress background indexes - :issue:`SERVER-35418`: Allow specifying CAs for incoming and outgoing connections separately. - :issue:`SERVER-36944`: applyOps does not permit unknown field names when creating a v:1 index. - :issue:`SERVER-37058`: Update with numeric field names inside an array can cause validation to fail. - :ref:`3.4.18-changelog` - `All JIRA issues closed in 3.4.18 `_ .. _3.4.17-release-notes: 3.4.17 - Sep 7, 2018 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-33857` Missing log redaction due to confusion with Command::redactForLogging(). - :issue:`SERVER-34846` Covered index with collated field returns incorrect result when collation not involved in match or sort. - :issue:`SERVER-36010` Change log messages for Windows stacktraces to use error() or severe() rather than log(). - :issue:`SERVER-34558`: Add SSL_version to client metadata logging. - :ref:`3.4.17-changelog` - `All JIRA issues closed in 3.4.17 `_ .. _3.4.16-release-notes: 3.4.16 - Jul 10, 2018 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-32999`: Platform Support: Remove Debian 7 builds. - :issue:`SERVER-29301`: Upgrade MozJS to ESR 45.9.0 - :issue:`SERVER-5461`: Add ``syncSourceHost`` field to ``replSetGetStatus`` output. - :ref:`3.4.16-changelog` - `All JIRA issues closed in 3.4.16 `_ .. _3.4.15-release-notes: 3.4.15 - May 16, 2018 ~~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-31535`: Platform Support: remove Ubuntu 12.04 builds. - :issue:`SERVER-32923`: Platform Support: remove SLES11 builds. - :issue:`SERVER-20056`: Log a startup warning if wiredTigerCacheSizeGB is > 80% of RAM. - :issue:`SERVER-28981`: Sharding balancer prefers shards in a specific order when moving chunks. - :ref:`3.4.15-changelog` - `All JIRA issues closed in 3.4.15 `_ .. _3.4.14-release-notes: 3.4.14 - March 20, 2018 ~~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-28151`: Authentication database should be synced first during an initial sync. - :issue:`SERVER-32886`: Unnecessary sleeps during chunk migration. - :issue:`SERVER-32933`: Allow ``mongod`` to start when unable to reach LDAP server. - :ref:`3.4.14-changelog` - `All JIRA issues closed in 3.4.14 `_ .. _3.4.13-release-notes: 3.4.13 - Feb 10, 2018 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-33238`: Prevent WiredTiger read ticket count from going negative. - :ref:`3.4.13-changelog` - `All JIRA issues closed in 3.4.13 `_ .. _3.4.12-release-notes: 3.4.12 - Feb 8, 2018 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-31437`: Fix parsing of ``mongo host/db`` connect string. - :issue:`SERVER-32875`: Don't stall ftdc due to running out of tickets. - :issue:`SERVER-33089`: Unable to start queryable mongod because it failed to regenerate index for ``admin.system.users``. - :ref:`3.4.12-changelog` - `All JIRA issues closed in 3.4.12 `_ .. _3.4.11-release-notes: 3.4.11 - Jan 31, 2018 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-19605`: Oplog timeout should be configurable. - :issue:`SERVER-19919`: Chunks that exceed 250000 docs but are under half chunk size get marked as jumbo. - :issue:`SERVER-29293`: Recipient shard fails to abort migration on stepdown. - :issue:`SERVER-32001`: unindexing a key in a partial unique index may cause server crash - :ref:`3.4.11-changelog` - `All JIRA issues closed in 3.4.11 `_ .. _3.4.10-release-notes: 3.4.10 - Oct 31, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-15723`: Avoid G_X lock for rename_collection within database - :issue:`SERVER-31049`: View with collation doesn't work as expected in sharded cluster - :issue:`SERVER-29287`: Upgrade pcre to 8.41 - :issue:`SERVER-31204`: Calling `shardCollection` after `enableSharding` may fail if executed against different mongos - :ref:`3.4.10-changelog` - `All JIRA issues closed in 3.4.10 `_ .. _3.4.9-release-notes: 3.4.9 - Sept 11, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-20392`: Sharding an existing small collection results in large number of chunks - :issue:`SERVER-30189`: Reduce calls to allocator for large $in expressions - :issue:`SERVER-30487`: RangeDeleter holds WT transaction open while waiting for majority - :issue:`SERVER-30636`: Range deleter assert failed because of replication lag - :ref:`3.4.9-changelog` - `All JIRA issues closed in 3.4.9 `_ .. _3.4.7-release-notes: 3.4.7 -- Aug 8, 2017 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-29282`: BSON Document Size can be exceeded when grouping inserts on SECONDARY nodes - :issue:`SERVER-29568`: Enable configuration of OpenSSL cipher suite via :parameter:`setParameter ` - :issue:`SERVER-29817`: Optimize incremental update performance of ChunkManager and CollectionMetadata - :ref:`3.4.7-changelog` - `All JIRA issues closed in 3.4.7 `_ .. _3.4.6-release-notes: 3.4.6 -- Jul 5, 2017 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-27347`: Only close idle cached cursors on the WiredTiger ident that is busy. - :issue:`SERVER-29618`: ``$geoWithin`` in aggregation pipeline after ``$lookup`` and ``$unwind`` returns incorrect results. - :issue:`WT-3362`: Cursor opens should never block for the duration of a checkpoint. - :ref:`3.4.6-changelog` - `All JIRA issues closed in 3.4.6 `_ .. _3.4.5-release-notes: 3.4.5 -- Jun 14, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-28952`: Multikey indexes should not be eligible for DISTINCT_SCAN if distinct key is an array component. - :issue:`SERVER-28427`: GlobalLock with timeout can still block indefinitely. - :issue:`SERVER-29018` :binary:`~bin.mongos` can segfault in ``getMore`` on views with find batchSize of 0. - :ref:`3.4.5-changelog` - `All JIRA issues closed in 3.4.5 `_ .. _3.4.4-release-notes: 3.4.4 -- Apr 21, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-18794`: Add an aggregation operator :expression:`$objectToArray` to convert an object to an array of key, value pairs. - :issue:`SERVER-23310`: Add an aggregation operator :expression:`$arrayToObject` to convert an array of pairs to an object. - :issue:`SERVER-22611`: ChunkManager refresh can occasionally cause a full reload. - :ref:`3.4.4-changelog` - `All JIRA issues closed in 3.4.4 `_ .. _3.4.3-release-notes: 3.4.3 -- Mar 28, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-27863`: Reschedule firing of early alarms in NetworkInterfaceASIO to avoid :binary:`~bin.mongos` crash. - :issue:`SERVER-28017`: :query:`$ne` should respect collection's default collation. - :issue:`SERVER-27700`: Improve WiredTiger performance on secondary when cache is full. - :ref:`3.4.3-changelog` - `All JIRA issues closed in 3.4.3 `_ .. _3.4.2-release-notes: 3.4.2 -- Feb 1, 2017 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-27125`: Arbiters in pv1 should vote no in elections if they can see a healthy primary of equal or greater priority to the candidate. - :issue:`SERVER-27584` Add support for filter to listDatabases - :issue:`WT-2670` Inefficient I/O when read full DB (poor readahead) - :ref:`3.4.2-changelog` - `All JIRA issues closed in 3.4.2 `_ .. _3.4.1-release-notes: 3.4.1 -- Dec 20, 2016 ~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-27124`: Disallow ``readConcern: majority`` reads on replica set protocolVersion 0 (pv0). - :issue:`SERVER-27201`: $graphLookup triggers null pointer dereference. - :issue:`SERVER-27207`: Find operation with a sort on a view via ``mongos`` may incorrectly return empty result set. - :issue:`SERVER-27213`: Two ``$match`` pipeline stages can combine incorrectly to produce incorrect results. - :ref:`3.4.1-changelog` - `All JIRA issues closed in 3.4.1 `_ .. _3.4-rel-notes-sharded-cluster: Sharded Cluster --------------- Membership Awareness ~~~~~~~~~~~~~~~~~~~~ Starting in 3.4, sharded cluster components (shards, config servers, :binary:`~bin.mongos` instances) recognize their membership in a sharded cluster, including the name of the sharded cluster, the location of the config servers. .. COMMENT To DOCS TEAM: Make sure we single source these things since used in relnotes and compatibility To support this awareness: - ``shardsvr`` Requirement For a 3.4 sharded cluster, :binary:`~bin.mongod` instances for the shards **must** explicitly specify its role as a ``shardsvr``, either via the configuration file setting :setting:`sharding.clusterRole` or via the command line option :option:`--shardsvr `. .. note:: Default port for :binary:`~bin.mongod` instances with the ``shardsvr`` role is ``27018``. To use a different port, specify :setting:`net.port` setting or ``--port`` option. .. COMMENT To DOCS TEAM: Ensure that in all our sharding tutorials we specify shardsvr. - 3.4 ``mongos`` Incompatibility with Earlier Versions of ``mongod`` Version 3.4 :binary:`~bin.mongos` instances cannot connect to earlier versions of :binary:`~bin.mongod` instances. Balancer on Config Server Primary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The balancer process has moved from the :binary:`~bin.mongos` to the primary member of the config server replica set. Associated with this change: - The primary of the CSRS config server holds the ``"balancer"`` lock, using a process id named ``"ConfigServer"``, which is never released. - MongoDB 3.4 adds: - :dbcommand:`balancerStart` command and updates the 3.4 :binary:`~bin.mongo` shell method :method:`sh.startBalancer()` to wrap the new command. A 3.2 or earlier :binary:`~bin.mongo` shell method :method:`sh.startBalancer()` is incompatible with a 3.4 sharded cluster. - :dbcommand:`balancerStop` command and updates the 3.4 :binary:`~bin.mongo` shell method :method:`sh.stopBalancer()` to wrap the new command. A 3.2 or earlier :binary:`~bin.mongo` shell method :method:`sh.stopBalancer()` is incompatible with a 3.4 sharded cluster. - :dbcommand:`balancerStatus` command. - MongoDB 3.4 deprecates :binary:`~bin.mongo` shell method :method:`sh.getBalancerHost()`. A 3.2 or earlier :binary:`~bin.mongo` shell method :method:`sh.getBalancerHost()` is incompatible with a 3.4 sharded cluster. - MongoDB 3.4 removes the following configuration options from the :binary:`~bin.mongos`: - :setting:`sharding.chunkSize` configuration file setting and ``--chunkSize`` command-line option - :setting:`sharding.autoSplit` configuration file setting and ``--noAutoSplit`` command-line option Faster Balancing ~~~~~~~~~~~~~~~~ Starting in MongoDB 3.4: - For :ref:`WiredTiger `, the default value ``secondaryThrottle`` is ``false`` for all chunk migrations. The balancer does not wait for replication to a secondary and instead continues with the next document. - MongoDB can perform parallel chunk migrations. Similar to earlier versions, a shard can participate in at most one migration at a time. Observing this restriction, for a sharded cluster with *n* shards, MongoDB can perform at most *n/2* (rounded down) simultaneous chunk migrations. .. _3.4-remove-sccc: Removal of Support for SCCC Config Servers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4 sharded clusters no longer support the use of mirrored (SCCC) :binary:`~bin.mongod` instances as config servers. The use of SCCC config servers, deprecated in the 3.2 release, is no longer valid. Instead, deploy your config servers as a replica set (CSRS). To upgrade your sharded cluster to version 3.4, the config servers must be running as a replica set. To convert your existing config servers from SCCC to CSRS, see :doc:`/tutorial/upgrade-config-servers-to-replica-set`. Sharding Zones ~~~~~~~~~~~~~~ MongoDB 3.4 introduces :doc:`/core/zone-sharding`, which supersedes tag-aware sharding available in earlier versions. To support zones, MongoDB introduces the following commands and :binary:`~bin.mongo` shell helpers: .. list-table:: :header-rows: 1 * - Commands - `mongo` Shell Methods * - :dbcommand:`addShardToZone` - :method:`sh.addShardToZone()` * - :dbcommand:`removeShardFromZone` - :method:`sh.removeShardFromZone()` * - :dbcommand:`updateZoneKeyRange` - | :method:`sh.updateZoneKeyRange()` | :method:`sh.removeRangeFromZone()` .. _3.4-replica-set: Replica Set ----------- Default Journaling Behavior of ``majority`` Write Concern ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A new replica set configuration setting :rsconf:`writeConcernMajorityJournalDefault` determines whether an acknowledgement for a write concern of :writeconcern:`majority <"majority">` returns after the majority of the voting members apply the write in memory or to the on-disk journal *if* the :ref:`j ` option is unspecified in the write concern. Adjustable Catchup Period for Newly Elected Primary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A new replica set configuration setting :rsconf:`settings.catchUpTimeoutMillis` defines the time limit for a newly elected primary to catch up with the other replica set members that may have more recent writes. Linearizable Read Concern ~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.4 introduces a read concern level of :readconcern:`"linearizable"` to read data that reflects all successful writes issued with a :writeconcern:`"majority"` *and* acknowledged prior to the start of the read operation. Linearizable read concern guarantees only apply if read operations specify a query filter that uniquely identifies a single document. Linearizable read concern is available for all MongoDB supported :doc:`storage engines `. Combined with :writeconcern:`"majority"` write concern, :readconcern:`"linearizable"` read concern enables multiple threads to perform reads and writes on a single document as if a single thread performed these operations in real time; that is, the corresponding schedule for these reads and writes is considered linearizable. Reads with linearizable read concern may be significantly slower than reads with :readconcern:`"majority"` or :readconcern:`"local"` read concerns. Always use ``maxTimeMS`` with linearizable read concern, in case a majority of data bearing members are unavailable. For example: .. code-block:: javascript db.restaurants.find( { _id: 5 } ).readConcern("linearizable").maxTimeMS(10000) db.runCommand( { find: "restaurants", filter: { _id: 5 }, readConcern: { level: "linearizable" }, maxTimeMS: 10000 } ) For more information on read concern, including operations that support read concerns, see :doc:`/reference/read-concern`. Improved Initial Sync ~~~~~~~~~~~~~~~~~~~~~ - MongoDB 3.4 improves the performance of :ref:`initial sync ` by having initial sync build the indexes as the documents are copied. - MongoDB 3.4 improves the :ref:`initial sync retry logic ` to be more resilient to intermittent failures on the network. - To avoid potential data corruption, MongoDB 3.4 fails and restarts :ref:`initial sync ` if a collection is renamed on the sync source during the initial sync. With MongoDB 3.2.11 or earlier, initial syncs did not fail and restart but instead continued the process, which could lead to potential data corruption. For details, see :ref:`3.4-compatibility-initial-sync`. - Modified :dbcommand:`replSetGetStatus` command to accept the optional ``initialSync: 1`` in the command to report on initial sync status and progress if run on the secondary: .. code-block:: javascript db.adminCommand( { replSetGetStatus: 1, initialSync: 1 } ) .. _3.4-decimal: Decimal Type ------------ 3.4 adds support for the `decimal128 format `_ with the new ``decimal`` data type. The decimal128 format supports numbers with up to 34 decimal digits (i.e. significant digits) and an exponent range of −6143 to +6144. To support the format, the :binary:`~bin.mongo` shell adds the :ref:`NumberDecimal ` wrapper. .. code-block:: javascript db.inventory.insert( {_id: 1, item: "The Scream", price: NumberDecimal("9.99"), quantity: 4 } ) When performing :ref:`comparisons ` among different numerical types, MongoDB performs comparison on the exact stored numerical values without first converting values to a common type. Unlike the ``double`` data type, which only stores an approximation of the decimal values, the ``decimal`` data type stores the exact value. For example, a ``decimal`` ``NumberDecimal("9.99")`` has a precise value of ``9.99`` where as a double ``9.99`` would have an approximate value of ``9.9900000000000002131628...``. To test for ``decimal`` type, use the :query:`$type` operator with the literal ``"decimal"`` or ``19``. .. code-block:: javascript db.inventory.find( { price: { $type: "decimal" } } ) To use the new ``decimal`` data type with a MongoDB driver, an upgrade to a driver version that supports the feature is necessary. .. _3.4-rel-notes-aggregation-cluster: Aggregation ----------- New Aggregation Stage for Recursive Search ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4 introduces a stage to the :doc:`aggregation pipeline ` that allows for recursive search. .. list-table:: :header-rows: 1 :widths: 20 80 * - Stage - Description * - :pipeline:`$graphLookup` - Performs a recursive search on a collection. To each output document, adds a new array field that contains the traversal results of the recursive search for that document. .. seealso:: `Webinar: Working with Graph Data in MongoDB `_ New Aggregation Stages for Faceted Search ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Faceted search allows for the categorization of documents into classifications. For example, given a collection of inventory documents, you may want to classify items by a single category, such as by the price range, or by multiple categories, such as by price range as well as separately by the departments. 3.4 introduces stages to the :doc:`aggregation pipeline ` that allow for faceted search. .. list-table:: :header-rows: 1 :widths: 20 80 * - Stage - Description * - :pipeline:`$bucket` - Categorizes or groups incoming documents into buckets that represent a range of values for a specified expression. * - :pipeline:`$bucketAuto` - Categorizes or groups incoming documents into specified number of buckets that represent a range of values for a specified expression. MongoDB automatically determines the bucket boundaries. * - :pipeline:`$facet` - Processes multiple :ref:`pipelines ` on the input documents and outputs a document that contains the results of these pipelines. By specifying facet-related stages (:pipeline:`$bucket`, :pipeline:`$bucketAuto`, and :pipeline:`$sortByCount`) in these pipelines, :pipeline:`$facet` allows for multi-faceted search. * - :pipeline:`$sortByCount` - Categorizes or groups incoming documents by a specified expression to compute the count for each group. Output documents are sorted in descending order by the count. New Aggregation Stages to Facilitate Reshaping Documents ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4 introduces stages to the :doc:`aggregation pipeline ` that faciliate replacing documents as well as adding new fields. .. list-table:: :header-rows: 1 :widths: 20 80 * - Stage - Description * - :pipeline:`$addFields` - Adds new fields to documents. The stage outputs documents that contains all existing fields from the input documents as well as the newly added fields. * - :pipeline:`$replaceRoot` - Replaces a document with the specified document. You can specify a document embedded in the input document to promote the embedded document to the top level. New Aggregation Stage to Count ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4 introduces a new stage to the :doc:`aggregation pipeline ` that faciliate counting document. .. list-table:: :header-rows: 1 :widths: 20 80 * - Stage - Description * - :pipeline:`$count` - Returns a document that contains a count of the number of documents input to the stage. New Aggregation Array Operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 20 80 * - Operator - Description * - :expression:`$in` - Returns a boolean that indicates if a specified value is in an array. * - :expression:`$indexOfArray` - Searches an array for an occurence of a specified value and returns the array index (zero-based) of the first occurence. * - :expression:`$range` - Returns an array whose elements are a generated sequence of numbers. * - :expression:`$reverseArray` - Returns an output array whose elements are those of the input array but in reverse order. * - :expression:`$reduce` - Takes an array as input and applies an expression to each element in the array to return the final result of the expression. * - :expression:`$zip` - Returns an output array where each element is itself an array, consisting of elements in the corresponding array index position from the input arrays. New Aggregation String Operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 20 80 * - Operator - Description * - :expression:`$indexOfBytes` - Searches a string for an occurence of a substring and returns the UTF-8 byte index (zero-based) of the first occurence. * - :expression:`$indexOfCP` - Searches a string for an occurence of a substring and returns the UTF-8 `code point `_ index (zero-based) of the first occurence. * - :expression:`$split` - Splits a string by a specified delimiter into string components and returns an array of the string components. * - :expression:`$strLenBytes` - Returns the number of UTF-8 bytes for a string. * - :expression:`$strLenCP` - Returns the number of UTF-8 `code points `_ for a string. * - :expression:`$substrBytes` - Returns the substring of a string. The substring starts with the character at the specified UTF-8 byte index (zero-based) in the string for the length specified. * - :expression:`$substrCP` - Returns the substring of a string. The substring starts with the character at the specified UTF-8 `code point `_ index (zero-based) in the string for the length specified. New Aggregation Control Flow Expression ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 20 80 * - Operator - Description * - :expression:`$switch` - Evaluates, in sequential order, the ``case`` expressions of the specified branches to enter the first branch for which the ``case`` expression evaluates to ``true``. New Date Aggregation Operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 20 80 * - Operator - Description * - :expression:`$isoDayOfWeek` - Returns the ISO 8601 weekday number, ranging from ``1`` (for Monday) to ``7`` (for Sunday). * - :expression:`$isoWeek` - Returns the ISO 8601 week number, which can range from ``1`` to ``53``. Week numbers start at ``1`` with the week (Monday through Sunday) that contains the year's first Thursday. * - :expression:`$isoWeekYear` - Returns the ISO 8601 year number, where the year starts with the Monday of week 1 (ISO 8601) and ends with the Sundays of the last week (ISO 8601). New Monitoring Aggregation Sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 20 80 * - Operator - Description * - :pipeline:`$collStats` - Returns statistics regarding a collection or view. New Type Operator ~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 26 74 * - Operator - Description * - :expression:`$type` - Returns a string which specifies the :doc:`/reference/bson-types/` of the argument. Additional Changes ~~~~~~~~~~~~~~~~~~ :pipeline:`$project` stage adds support for field exclusion in the output document. Previously, you could only exclude the ``_id`` field in the stage. If you specify the exclusion of a field or fields, - All other fields are returned in the output documents. - You cannot specify new fields or the inclusion of other fields. .. _3.4-relnotes-collation: Collation and Case-Insensitive Indexes -------------------------------------- To allow for language-specific rules for string comparison, MongoDB 3.4 introduces :doc:`collation ` to its query language and indexes. The following operations support collation: .. include:: /includes/extracts/collation-operations-table.rst For details, see :doc:`Collation `. .. [#index-restriction] Some index types do not support collation. See :ref:`collation-unsupported-index-types` for details. .. _3.4-relnotes-views: Views ----- MongoDB 3.4 adds support for creating read-only views from existing collections or other views. To specify or define a view, MongoDB 3.4 introduces: - the ``viewOn`` and ``pipeline`` options to the existing :dbcommand:`create` command: .. code-block:: javascript db.runCommand( { create: , viewOn: , pipeline: } ) or if specifying a default :ref:`collation <3.4-relnotes-collation>` for the view: .. code-block:: javascript db.runCommand( { create: , viewOn: , pipeline: , collation: } ) - and a corresponding :binary:`~bin.mongo` shell helper :method:`db.createView()`: .. code-block:: javascript db.createView(, , , ) For more information on creating views, see :ref:`3.4-reference-views`. Security Enhancement -------------------- Transition to Auth ~~~~~~~~~~~~~~~~~~ MongoDB 3.4 adds support for rolling transition to internal authentication for replica sets and sharded clusters. For details, see :setting:`security.transitionToAuth` setting and ``--transitionToAuth`` command line option for :binary:`~bin.mongod` and :binary:`~bin.mongos`. .. seealso:: :doc:`/tutorial/enforce-keyfile-access-control-in-existing-replica-set-without-downtime` User Roles Changes ~~~~~~~~~~~~~~~~~~ .. include:: /includes/fact-3.4-built-in-roles-changes.rst MongoDB Tools ------------- ``mongoreplay`` ~~~~~~~~~~~~~~~ MongoDB introduces :binary:`~bin.mongoreplay`, a workload capture and analysis tool that replaces :binary:`~bin.mongosniff`. You can use :binary:`~bin.mongoreplay` to inspect and record commands sent to a MongoDB instance, and then replay the commands back onto another host at a later time. :binary:`~bin.mongoreplay` is available for Linux and macOS. General Enhancements -------------------- MongoDB 3.4 includes the following enhancements: - Added ``systemd`` support in distributions. - Increased :parameter:`diagnosticDataCollectionDirectorySizeMB` default size to 200 megabytes from 100 megabytes. - Decreased the lower bound and the default setting of the :option:`WiredTiger internal cache `. Both the :option:`WiredTiger Storage Engine internal cache ` and the :option:`inMemory Storage Engine maximum memory size ` can accept floating-point values. - :method:`~db.collection.find()`, :method:`~db.collection.aggregate()`, :dbcommand:`listIndexes`, and :dbcommand:`listCollections` operations return a :ref:`maximum of 16 megabytes per batch `. :method:`db.currentOp` and the :doc:`database profiler` report the same basic diagnostic information for all CRUD operations, including the following: - .. include:: /includes/fact-diagnostic-info.rst - :binary:`~bin.mongo` shell adds support for marshalling fields of type :ref:`javascript` and :ref:`javascriptWithScope` to JavaScript functions. See :option:`--disableJavaScriptProtection `. - Added support for system certificates. If a :binary:`~bin.mongod` instance presents a certificate signed with a CA trusted by the operating system, the :binary:`~bin.mongo` shell will connect without any errors. Previously, the :binary:`~bin.mongo` shell exited with an error that it could not validate the certificate. - Added message compression support for internal communication between members of a replica set or a sharded cluster as well as communication between :binary:`~bin.mongo` shell and :binary:`~bin.mongod` or :binary:`~bin.mongos`. See configuration :setting:`net.compression.compressors` setting as well as the ``--networkMessageCompressors`` option for :binary:`~bin.mongod`, :binary:`~bin.mongos`, and the :binary:`~bin.mongo` shell. - Upgraded the SpiderMonkey JavaScript engine to 45.0.2 ESR. Platform Support ---------------- - MongoDB 3.4 introduces support for ARM64, PPC64LE, and s390x architectures. See :ref:`prod-notes-supported-platforms` to see the full platform support matrix. - .. include:: /includes/fact-installation-rhel5.rst .. include:: /includes/admonition-power-ubuntu-restriction.rst .. include:: /includes/list-table-products-supported-architecture.rst For details, refer to the individual documentation for the products. MongoDB Enterprise Features --------------------------- Log Redaction ~~~~~~~~~~~~~ MongoDB Enterprise adds support for log redaction for use in conjunction with MongoDB's :doc:`encrypted storage engine `. Log redaction prevents potentially sensitive information from being written to the diagnostic log; however, diagnostics on redacted logs may be more difficult due to the lack of data related to a log event. To enable log redaction, see the :setting:`security.redactClientLogData` setting and the :option:`--redactClientLogData ` option for :binary:`~bin.mongod`. LDAP Enhancements ~~~~~~~~~~~~~~~~~ LDAP Authorization `````````````````` MongoDB Enterprise supports the use of :doc:`Lightweight Directory Access Protocol (LDAP) service to authorize (i.e. determine access) ` a user authenticated via one of the following authentication mechanism: - :doc:`/core/security-ldap`. For a tutorial on using both LDAP Authentication and Authorization, see :doc:`/tutorial/authenticate-nativeldap-activedirectory`. - :doc:`/core/kerberos`. For a tutorial on using Kerberos authentication and Active Directory, see :doc:`/tutorial/kerberos-auth-activedirectory-authz`. - :doc:`/core/security-x.509`. For more information, see :doc:`/core/security-ldap-external`. ``mongoldap`` ````````````` MongoDB Enterprise provides a new tool :binary:`~bin.mongoldap` for testing your MongoDB :ref:`LDAP configuration options ` against a running LDAP server or set of servers. When configuring options related to :ref:`LDAP authentication `, you can use :binary:`~bin.mongoldap` to ensure that the authentication operation works as expected. Bind via OS Libraries `````````````````````` MongoDB 3.4 supports :doc:`binding to an LDAP server ` via operating system libraries. This allows Linux and Windows MongoDB 3.4 servers to use an LDAP server for authentication. Linux MongoDB deployments continue to support binding via `saslauthd `_. Changes Affecting Compatibility ------------------------------- Some changes can affect compatibility and may require user actions. For a detailed list of compatibility changes, see :doc:`/release-notes/3.4-compatibility`. .. class:: hidden .. toctree:: /release-notes/3.4-compatibility .. _3.4-upgrade: Upgrade Procedures ------------------ - :doc:`/release-notes/3.4-upgrade-standalone`. - :doc:`/release-notes/3.4-upgrade-replica-set`. - :doc:`/release-notes/3.4-upgrade-sharded-cluster`. If you need guidance on upgrading to 3.4, `MongoDB offers major version upgrade services `_ to help ensure a smooth transition without interruption to your MongoDB application. Download -------- To download the MongoDB 3.4, go to the `MongoDB Download Center `_ .. seealso:: - `All Third Party License Notices `_. .. class:: hidden .. toctree:: :titlesonly: /release-notes/3.4-upgrade-standalone /release-notes/3.4-upgrade-replica-set /release-notes/3.4-upgrade-sharded-cluster /release-notes/3.4-downgrade Known Issues in 3.4.0 --------------------- List of known issues in the 3.4.0 release: - :issue:`SERVER-27124`: :rsconf:`protocolVersion: 0 ` cannot properly support :readconcern:`"majority"` read concern. - :issue:`SERVER-27195`: Using collation with documents containing fields of BSON type ``Symbol``, which is deprecated, is not supported and may lead to undefined behavior. - :issue:`SERVER-27207`: Find on view with sort through :binary:`~bin.mongos` may incorrectly return empty result set. - :issue:`WT-3327`: :ref:`Checkpoints ` can hang if time runs backwards (e.g. on a system with an unreliable clock). (Fixed in :ref:`MongoDB 3.4.6 <3.4.6-release-notes>`.) .. include:: /includes/unicode-checkmark.rst