============================= Release Notes for MongoDB 3.2 ============================= .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 1 :class: twocols *Dec 8, 2015* MongoDB 3.2 is now available. Key features include WiredTiger as the default storage engine, replication election enhancements, config servers as replica sets, ``readConcern``, and document validations. OpsManager 2.0 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.2-changelog .. _3.2.22-release-notes: 3.2.22 - Dec 28, 2018 ~~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-38425` Oplog Visibility Query is a collection scan in 3.2.21 - :ref:`3.2.22-changelog` - `All JIRA issues closed in 3.2.22 `_ .. _3.2.21-release-notes: 3.2.21 - Sep 7, 2018 ~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-32999`: Platform Support: remove Debian 7. - :issue:`SERVER-36010` Change log messages for Windows stacktraces to use error() or severe() rather than log(). - :issue:`SERVER-30724` Initial sync might miss ops that were in flight when it started. - :ref:`3.2.21-changelog` - `All JIRA issues closed in 3.2.21 `_ .. _3.2.20-release-notes: 3.2.20 - May 10, 2018 ~~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-32241`: applyOps reports success even when a nested applyOps fails. - :issue:`SERVER-32923`: Platform Support: remove SLES11 builds. - :issue:`SERVER-31535`: Platform Support: remove Ubuntu 12.04 builds. - :ref:`3.2.20-changelog` - `All JIRA issues closed in 3.2.20 `_ .. _3.2.19-release-notes: 3.2.19 - Feb 6, 2018 ~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-30189`: Reduce calls to allocator for large $in expressions - :issue:`SERVER-30853`: Update Mongod init scripts to set unlimited locked memory - :issue:`SERVER-32001`: Unindexing a key in a partial unique index may cause server crash - :issue:`SERVER-32048`: Updates using a numeric path component may cause index entries not to be created - :ref:`3.2.19-changelog` - `All JIRA issues closed in 3.2.19 `_ .. _3.2.18-release-notes: 3.2.18 - Nov 29, 2017 ~~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-29287`: Upgrade pcre to 8.41 - :issue:`SERVER-31101`: WT table not dropped after collection is dropped due to long-running OperationContext - :issue:`SERVER-31149`: Enable recovery progress messages - :ref:`3.2.18-changelog` - `All JIRA issues closed in 3.2.18 `_ .. _3.2.17-release-notes: 3.2.17 - Sept 28, 2017 ~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-30636`: RangeDeleter assert failed because of replication lag - :issue:`SERVER-30943`: Segmentation fault on attempt to access an invalidated BSON Object in JS scope - :issue:`WT-3327`: Checkpoints can hang if time runs backward - :ref:`3.2.17-changelog` - `All JIRA issues closed in 3.2.17 `_ .. _3.2.16-release-notes: 3.2.16 - Jul 27, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-26952`: Cache SCRAM-SHA-1 ClientKey - :issue:`SERVER-28578`: When doing an upgrade from PV0 to PV1, we should not return from the reconfigure until the lastVote document is written. - :issue:`SERVER-29568`: Enable configuration of OpenSSL cipher suite via :parameter:`setParameter ` - :ref:`3.2.16-changelog` - `All JIRA issues closed in 3.2.16 `_ .. _3.2.15-release-notes: 3.2.15 - Jul 5, 2017 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-29237`: Add ShardingTaskExecutorPoolMaxConnecting flag for :binary:`~bin.mongos`. - :issue:`SERVER-29850`: Access violation due to a bug in internal page splitting in WiredTiger. - :issue:`WT-3362`: Cursor opens should never block for the duration of a checkpoint. - :ref:`3.2.15-changelog` - `All JIRA issues closed in 3.2.15 `_ .. _3.2.14-release-notes: 3.2.14 -- Jun 13, 2017 ~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-26452`: ``renameCollection`` should handle write conflicts. - :issue:`SERVER-29365`: No-op ``applyOps`` does not wait for majority writeConcern before returning. - :issue:`SERVER-28014`: When ssl mode is ``preferSSL``, should log connections that do not use SSL. - :ref:`3.2.14-changelog` - `All JIRA issues closed in 3.2.14 `_ .. _3.2.13-release-notes: 3.2.13 -- May 1, 2017 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-3181`: Add ``nameOnly`` option to listDatabases to only get db names, not size info. - :issue:`SERVER-21818`: Capture system metrics in FTDC - :issue:`SERVER-25318`: Limit total memory utilization for bulk index builds - :ref:`3.2.13-changelog` - `All JIRA issues closed in 3.2.13 `_ .. _3.2.12-release-notes: 3.2.12 -- 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-25012`: :dbcommand:`createIndex` blocks for duration of checkpoint while holding locks. - :issue:`SERVER-25865`: :pipeline:`$group` operation is slow on Windows. - :issue:`SERVER-26117`: If a collection is renamed on the sync source while an :ref:`initial sync ` is running, the initial sync process fails and restarts to avoid possible data corruption. For details, see :ref:`init-sync-compatibility`. - :ref:`3.2.12-changelog` - `All JIRA issues closed in 3.2.12 `_ .. _3.2.11-release-notes: 3.2.11 -- Nov 18, 2016 ~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-26182`: In a mixed version replica set with v3.2 and v3.0 members, a sync of a v3.2 member from a v3.0 member can result in a query response that exceed 16 MB BSON size limit and crash the v3.2 member. - :issue:`SERVER-24662`: Upgrade to Perl compatible regular expressions (PCRE 8.39). - :issue:`SERVER-26652` Invalid definitions in ``systemd`` configuration for Debian. - :issue:`SERVER-24386`: ``killCursor`` operation during aggregation pipeline can cause segmentation fault. - :ref:`3.2.11-changelog` - `All JIRA issues closed in 3.2.11 `_ .. _3.2.10-release-notes: 3.2.10 -- Sep 30, 2016 ~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-25974`: When WT cache utilization is full, application threads can stall for an extended period of time. - :issue:`SERVER-20306`: MongoDB with WiredTiger may experience excessive memory fragmentation, leading to swapping and/or out-of-memory errors. - :issue:`SERVER-16801`: When updating a field of one numerical type to the same number of different numerical type, update operation considers it as a noop. - :ref:`3.2.10-changelog` - `All JIRA issues closed in 3.2.10 `_ .. _3.2.9-release-notes: 3.2.9 -- Aug 16, 2016 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-7285`: Support systemd in future compatible Ubuntu distributions. - :issue:`WT-2798`: Create operations on WiredTiger when journaling is disabled may lead to inconsistent data in the event of a crash. - :issue:`SERVER-17856`: On :binary:`~bin.mongod` instances, users can run :dbcommand:`currentOp` and :dbcommand:`killOp` on own operations. - :ref:`3.2.9-changelog` - `All JIRA issues closed in 3.2.9 `_ .. _3.2.8-release-notes: 3.2.8 -- Jul 12, 2016 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-18329`: Debian 8(Jessie) packages. - :issue:`SERVER-24580`: Improve performance when WiredTiger cache is full. - :issue:`WT-2696`: Race condition on unclean shutdown may miss log records with large updates. - :issue:`WT-2706`: Race condition on log file switch can cause missing log records. - :ref:`3.2.8-changelog` - `All JIRA issues closed in 3.2.8 `_ .. _3.2.7-release-notes: 3.2.7 -- Jun 7, 2016 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-24054`: JS segmentation fault on load of certain NaNs. - :issue:`SERVER-24058`: Connection pool asio doesn't honor setup timeouts. - :issue:`SERVER-24117`: Mongo binaries ELF stack has become executable. - :ref:`3.2.7-changelog` - `All JIRA issues closed in 3.2.7 `_ .. _3.2.6-release-notes: 3.2.6 -- Apr 28, 2016 ~~~~~~~~~~~~~~~~~~~~~ - First production release of the :doc:`in-memory storage engine `. Issues fixed: - :issue:`SERVER-22970`: Background index build may result in extra index key entries that do not correspond to indexed documents. - :issue:`SERVER-22043`: :binary:`~bin.mongo` shell method :method:`~cursor.count()` ignores read preference. - :ref:`3.2.6-changelog` - `All JIRA issues closed in 3.2.6 `_ .. _3.2.5-release-notes: 3.2.5 -- Apr 14, 2016 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-22964`: IX GlobalLock held while waiting for WiredTiger cache eviction. - :issue:`SERVER-22831`: Low query rate with heavy cache pressure and an idle collection. - :issue:`SERVER-21681`: Include index size stats for in-memory storage engine. - :ref:`3.2.5-changelog` - `All JIRA issues closed in 3.2.5 `_ .. _3.2.4-release-notes: 3.2.4 -- Mar 8, 2016 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-22495`, :issue:`SERVER-22728`: Update optime when running with journaling disabled. - :issue:`SERVER-22269`: Have read concern ``majority`` reflect journaled state on the primary - :issue:`SERVER-22683`: :setting:`replication.enableMajorityReadConcern` ignores actual setting value and instead implies ``true``. - :issue:`SERVER-22043`: :method:`~cursor.count()` method in the :binary:`~bin.mongo` shell does not apply the read preferences. - :ref:`3.2.4-changelog` - `All JIRA issues closed in 3.2.4 `_ .. _3.2.3-release-notes: 3.2.3 -- Feb 17, 2016 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-22261`: For MMAPv1 journaling, the "last sequence number" file (``lsn`` file) may be ahead of what is synced to the data files. - :issue:`SERVER-22167`: In some cases, insert operations fails to add the ``_id`` field to large documents. - :issue:`SERVER-22456`: Increased timeout for querying oplog to 1 minute. - :ref:`3.2.3-changelog` - `All JIRA issues closed in 3.2.3 `_ 3.2.2 -- Feb 16, 2016 ~~~~~~~~~~~~~~~~~~~~~ Replaced by MongoDB 3.2.3. Users wishing to run MongoDB 3.2 should skip 3.2.2 and upgrade directly to 3.2.3. .. _3.2.1-release-notes: 3.2.1 -- Jan 12, 2016 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-21868`: During a regular shutdown of a replica set, secondaries may mark certain replicated but yet to be applied operations as successfully applied. - :issue:`SERVER-20262`: Improve insert workload performance with WiredTiger on Windows. - :issue:`SERVER-21366`: Long-running transactions during chunk moves. - :ref:`3.2.1-changelog` - `All JIRA issues closed in 3.2.1 `_ WiredTiger as Default --------------------- Starting in 3.2, MongoDB uses the WiredTiger as the default storage engine. To specify the MMAPv1 storage engine, you must specify the storage engine setting either: - On the command line with the ``--storageEngine`` option: .. code-block:: sh mongod --storageEngine mmapv1 - Or in a :doc:`configuration file `, using the :setting:`storage.engine` setting: .. code-block:: yaml storage: engine: mmapv1 .. note:: For existing deployments, if you do not specify the ``--storageEngine`` or the :setting:`storage.engine` setting, MongoDB 3.2 can automatically determine the storage engine used to create the data files in the ``--dbpath`` or :setting:`storage.dbPath`. If specifying ``--storageEngine`` or :setting:`storage.engine`, :binary:`~bin.mongod` will not start if ``dbPath`` contains data files created by a storage engine other than the one specified. .. seealso:: :ref:`3.2-storage-engine-compatibility` WiredTiger Default Cache Size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 3.2, the WiredTiger internal cache, by default, will use the larger of either: - 60% of RAM minus 1 GB, or - 1 GB. For more information, see :ref:`WiredTiger and Memory Use `. WiredTiger Journal Write Frequency ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 configures WiredTiger to write to the journal files at every 50 milliseconds. This is in addition to the existing journal write intervals and conditions. For more information, see :ref:`journal-process`. .. _3.2-rel-notes-rs-enhancements: Replication Election Enhancements --------------------------------- Starting in MongoDB 3.2, MongoDB reduces replica set failover time and accelerates the detection of multiple simultaneous primaries. As part of this enhancement, MongoDB introduces a version 1 of the replication protocol. New replica sets will, by default, use :rsconf:`protocolVersion: 1 `. Previous versions of MongoDB use version 0 of the protocol. In addition, MongoDB introduces a new :doc:`replica set configuration ` option :rsconf:`~settings.electionTimeoutMillis`. :rsconf:`~settings.electionTimeoutMillis` specifies the time limit in milliseconds for detecting when a replica set's primary is unreachable. :rsconf:`~settings.electionTimeoutMillis` only applies if using the version 1 of the :rsconf:`replication protocol `. .. _3.2-rel-notes-sharded-cluster: Sharded Cluster Enhancements ---------------------------- MongoDB 3.2 deprecates the use of three mirrored :binary:`~bin.mongod` instances for config servers. Instead, starting in 3.2, the :doc:`config servers ` for a sharded cluster can be deployed as a replica set. The replica set config servers must run the WiredTiger storage engine. This change improves consistency across the config servers, since MongoDB can take advantage of the standard replica set read and write protocols for sharding config data. In addition, this allows a sharded cluster to have more than 3 config servers since a replica set can have up to 50 members. For more information, see :doc:`/core/sharded-cluster-config-servers`. To deploy a **new** sharded cluster with replica set config servers, see :doc:`/tutorial/deploy-shard-cluster`. .. include:: /includes/extracts/master-slave-deprecated-for-sharded-cluster.rst Starting in 3.2, :binary:`~bin.mongos`, during its startup, will continue to try to contact the config servers until one becomes available. In previous versions, :binary:`~bin.mongos`, during its startup, would shut down if it could not find a config server. .. _3.2-rel-notes-readConcern: ``readConcern`` --------------- MongoDB 3.2 introduces the ``readConcern`` query option for replica sets and replica set shards. For the :doc:`WiredTiger storage engine `, the ``readConcern`` option allows clients to choose a level of isolation for their reads. You can specify a ``readConcern`` of ``"majority"`` to read data that has been written to a majority of nodes and thus cannot be rolled back. By default, MongoDB uses a ``readConcern`` of ``"local"`` to return the most recent data available to the node at the time of the query, even if the data has not been persisted to a majority of nodes and may be rolled back. With the :doc:`MMAPv1 storage engine `, you can only specify a ``readConcern`` of ``"local"``. ``readConcern`` requires MongoDB drivers updated for MongoDB 3.2. .. include:: /includes/fact-readConcern-majority-protocolVersion.rst For details on ``readConcern``, including operations that support the option, see :doc:`/reference/read-concern`. Partial Indexes --------------- MongoDB 3.2 provides the option to create indexes that only index the documents in a collection that meet a specified filter expression. By indexing a subset of the documents in a collection, partial indexes have lower storage requirements and reduced performance costs for index creation and maintenance. You can specify a ``partialFilterExpression`` option for all MongoDB :ref:`index types `. The ``partialFilterExpression`` option accepts a document that specifies the condition using: - equality expressions (i.e. ``field: value`` or using the :query:`$eq` operator), - :query:`$exists: true <$exists>` expression, - :query:`$gt`, :query:`$gte`, :query:`$lt`, :query:`$lte` expressions, - :query:`$type` expressions, - :query:`$and` operator at the top-level only For details, see :doc:`/core/index-partial`. .. _3.2-rel-notes-document-validation: Document Validation ------------------- Starting in 3.2, MongoDB provides the capability to validate documents during updates and insertions. Validation rules are specified on a per-collection basis. To specify document validation on a new collection, use the new ``validator`` option in the :method:`db.createCollection()` method. To add document validation to an existing collection, use the new ``validator`` option in the :dbcommand:`collMod` command. For more information, see :doc:`/core/document-validation`. To view the validation specifications for a collection, use the :method:`db.getCollectionInfos()` method. The following operations can bypass validation per operation using the new option ``bypassDocumentValidation``: .. list-table:: :header-rows: 1 :class: border-table * - Command - ``mongo`` Shell Method * - :dbcommand:`aggregate` when used with :pipeline:`$out` - :method:`db.collection.aggregate()` when used with :pipeline:`$out` * - :dbcommand:`applyOps` - * - :dbcommand:`cloneCollection` - * - :dbcommand:`clone` - * - :dbcommand:`copydb` - * - :dbcommand:`findAndModify` - :method:`db.collection.findAndModify()` * - :dbcommand:`insert` - * - :dbcommand:`mapReduce` - :method:`db.collection.mapReduce()` * - :dbcommand:`update` - For deployments that have enabled access control, you must have :authaction:`bypassDocumentValidation` action. The built-in roles :authrole:`dbAdmin` and :authrole:`restore` provide this action. Aggregation Framework Enhancements ---------------------------------- MongoDB introduces: - New stages, accumulators, and expressions. - :ref:`Availability of accumulator expressions <3.2-agg-accumulator-availability>` in :pipeline:`$project` stage. - :ref:`Performance improvements <3.2-agg-shard-optimization>` on sharded clusters. New Aggregation Stages ~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 10 40 50 * - Stage - Description - Syntax * - :pipeline:`$sample` - Randomly selects N documents from its input. - ``{ $sample: { size: } }`` * - :pipeline:`$indexStats` - Returns statistics on index usage. - ``{ $indexStats: { } }`` * - :pipeline:`$lookup` - Performs a left outer join with another collection. - .. code-block:: none { $lookup: { from: , localField: , foreignField: , as: } } New Accumulators for ``$group`` Stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 10 40 50 * - Accumulator - Description - Syntax * - :group:`$stdDevSamp` - Calculates standard deviation. - ``{ $stdDevSamp: }`` * - :group:`$stdDevPop` - Calculates population standard deviation. - ``{ $stdDevPop: }`` New Aggregation Arithmetic Operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 10 40 50 * - Operator - Description - Syntax * - :expression:`$sqrt` - Calculates the square root. - ``{ $sqrt: }`` * - :expression:`$abs` - Returns the absolute value of a number. - ``{ $abs: }`` * - :expression:`$log` - Calculates the log of a number in the specified base. - ``{ $log: [ , ] }`` * - :expression:`$log10` - Calculates the log base 10 of a number. - ``{ $log10: }`` * - :expression:`$ln` - Calculates the natural log of a number. - ``{ $ln: }`` * - :expression:`$pow` - Raises a number to the specified exponent. - ``{ $pow: [ , ] }`` * - :expression:`$exp` - Raises *e* to the specified exponent. - ``{ exp: }`` * - :expression:`$trunc` - Truncates a number to its integer. - ``{ $trunc: }`` * - :expression:`$ceil` - Returns the smallest integer greater than or equal to the specified number. - ``{ $ceil: }`` * - :expression:`$floor` - Returns the largest integer less than or equal to the specified number. - ``{ floor: }`` New Aggregation Array Operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 10 35 55 * - Operator - Description - Syntax * - :expression:`$slice` - Returns a subset of an array. - ``{ $slice: [ , ] }`` or ``{ $slice: [ , , ] }`` * - :expression:`$arrayElemAt` - Returns the element at the specified array index. - ``{ $arrayElemAt: [ , ] }`` * - :expression:`$concatArrays` - Concatenates arrays. - .. code-block:: javascript { $concatArrays: [ , , ... ] } * - :expression:`$isArray` - Determines if the operand is an array. - ``{ $isArray: [ ] }`` * - :expression:`$filter` - Selects a subset of the array based on the condition. - .. code-block:: javascript { $filter: { input: , as: , cond: } } .. _3.2-agg-accumulator-availability: Accumulator Expression Availability ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in version 3.2, the following accumulator expressions, previously only available in the :pipeline:`$group` stage, are now also available in the :pipeline:`$project` stage: - :group:`$avg` - :group:`$min` - :group:`$max` - :group:`$sum` - :group:`$stdDevPop` - :group:`$stdDevSamp` When used as part of the :pipeline:`$project` stage, these accumulator expressions can accept either: - A single argument: `` : `` - Multiple arguments: `` : [ , , ... ]`` General Enhancements ~~~~~~~~~~~~~~~~~~~~ - In MongoDB 3.2, :pipeline:`$project` stage supports using the square brackets ``[]`` to directly create new array fields. For an example, see :ref:`example-project-new-array-fields`. - MongoDB 3.2 introduces the ``minDistance`` option for the :pipeline:`$geoNear` stage. - :pipeline:`$unwind` stage no longer errors on non-array operand. If the operand does not resolve to an array but is not missing, null, or an empty array, :pipeline:`$unwind` treats the operand as a single element array. :pipeline:`$unwind` stage can: - include the array index of the array element in the output by specifying a new option ``includeArrayIndex`` in the stage specification. - output those documents where the array field is missing, null or an empty array by specifying a new option ``preserveNullAndEmptyArrays`` in the stage specification. To support these new features, :pipeline:`$unwind` can now take an alternate syntax. See :pipeline:`$unwind` for details. .. _3.2-agg-shard-optimization: Optimization ~~~~~~~~~~~~ Indexes can :ref:`cover ` aggregation operations. MongoDB improves the overall performance of the pipeline in large sharded clusters. If the pipeline starts with an exact :pipeline:`$match` on a shard key, the entire pipeline runs on the matching shard only. Previously, the pipeline would have been split, and the work of merging it would have to be done on the primary shard. For aggregation operations that run on multiple shards, if the operations do not require running on the database's primary shard, these operations can route the results to any shard to merge the results and avoid overloading the primary shard for that database. Aggregation operations that require running on the database's primary shard are the :pipeline:`$out` stage and :pipeline:`$lookup` stage. Compatibility ~~~~~~~~~~~~~ For compatibility changes, see :ref:`3.2-agg-compatibility`. MongoDB Tools Enhancements -------------------------- - :binary:`~bin.mongodump` and :binary:`~bin.mongorestore` add support for archive files and standard output/input streams with a new ``--archive`` option. This enhancement allows for the streaming of the dump data over a network device via a pipe. For examples, see - :ref:`mongodump to an Archive File ` and :ref:`mongodump an Archive to Standard Output ` - :ref:`mongorestore-example-archive-file` and :ref:`mongorestore-example-archive-stdin`. - :binary:`~bin.mongodump` and :binary:`~bin.mongorestore` add support for compressed data dumps with a new ``--gzip`` option. This enhancement reduces storage space for the dump files. For examples, see: - :ref:`Compress mongodump Output ` - :ref:`mongorestore-example-gzip`. .. _3.2-rel-notes-encryption: Encrypted Storage Engine ------------------------ .. include:: /includes/fact-enterprise-only-admonition.rst .. important:: Available for the WiredTiger Storage Engine only. Encryption at rest, when used in conjunction with transport encryption and good security policies that protect relevant accounts, passwords, and encryption keys, can help ensure compliance with security and privacy standards, including HIPAA, PCI-DSS, and FERPA. MongoDB Enterprise 3.2 introduces a native encryption option for the WiredTiger storage engine. This feature allows MongoDB to encrypt data files such that only parties with the decryption key can decode and read the data. For detail, see :ref:`encrypted-storage-engine`. Text Search Enhancements ------------------------ .. _3.2-relnotes-text-index-v3: ``text`` Index Version 3 ~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 introduces a version 3 of the :doc:`text index `. Key features of the new version of the index are: - Improved :ref:`case insensitivity `. - :ref:`Diacritic insensitivity `. - Additional :ref:`delimiters for tokenization `. Starting in MongoDB 3.2, version 3 is the default version for new :doc:`text ` indexes. .. seealso:: :ref:`3.2-text-index-compatibility` .. _3.2-relnotes-text-operator: ``$text`` Operator Enhancements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The :query:`$text` operator adds support for: - :ref:`case sensitive text search ` with the new ``$caseSensitive`` option, and - :ref:`diacritic sensitive text search ` with the new ``$diacriticSensitive`` option. For more information and examples, see the :query:`$text` operator reference sections :ref:`text-operator-case-sensitivity` and :ref:`text-operator-diacritic-sensitivity`. Support for Additional Languages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/fact-enterprise-only-admonition.rst Starting in 3.2, MongoDB Enterprise provides support for the following languages: Arabic, Farsi (specifically Dari and Iranian Persian dialects), Urdu, Simplified Chinese, and Traditional Chinese. For details, see :doc:`/tutorial/text-search-with-rlp`. New Storage Engines ------------------- ``inMemory`` Storage Engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/fact-enterprise-only-admonition.rst MongoDB Enterprise 3.2 provides an in-memory storage engine. Other than some metadata, the in-memory storage engine does not maintain any on-disk data. By avoiding disk I/O, the in-memory storage engine allows for more predictable latency of database operations. To select this storage engine, specify - ``inMemory`` for the :option:`--storageEngine ` option or the :setting:`storage.engine` setting. - ``--dbpath``. Although the in-memory storage engine does not write data to the filesystem, it maintains in the ``--dbpath`` small metadata files and diagnostic data as well temporary files for building large indexes. The ``inMemory`` storage engine uses document-level locking. For more details, see :doc:`/core/inmemory`. ``ephemeralForTest`` Storage Engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 provides a new for-test storage engine. Other than some metadata, the for-test storage engine does not maintain any on-disk data, removing the need to clean up between test runs. The for-test storage engine is unsupported. .. warning:: For test purposes only. Do not use in production. To select this storage engine, specify - ``ephemeralForTest`` for the :option:`--storageEngine ` option or the :setting:`storage.engine` setting. - ``--dbpath``. Although the for-test storage engine does not write data to the filesystem, it maintains small metadata files in the ``--dbpath``. The ``ephemeralForTest`` storage engine uses collection-level locking. .. _3.2-general-enhancements: General Enhancements -------------------- Bit Test Query Operators ~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 provides new query operators to test bit values: - :query:`$bitsAllSet` - :query:`$bitsAllClear` - :query:`$bitsAnySet` - :query:`$bitsAnyClear` SpiderMonkey JavaScript Engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 uses SpiderMonkey as the JavaScript engine for the :binary:`~bin.mongo` shell and :binary:`~bin.mongod` server. SpiderMonkey provides support for additional platforms and has an improved memory management model. This change affects all JavaScript behavior including the commands :dbcommand:`mapReduce`, :dbcommand:`group`, and the query operator :query:`$where`; *however*, this change should be completely transparent to the user. .. seealso:: :ref:`3.2-spidermonkey-compatibility` ``mongo`` Shell and CRUD API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To provide consistency with the MongoDB drivers' CRUD (Create/Read/Update/Delete) API, the :binary:`~bin.mongo` shell introduces additional CRUD methods that are consistent with the drivers' CRUD API: .. list-table:: :header-rows: 1 * - New API - Description * - :method:`db.collection.bulkWrite()` - Equivalent to initializing :method:`Bulk()` operations builder, using :ref:`Bulk methods ` to add operations, and running :method:`Bulk.execute()` to execute the operations. MongoDB 3.2 deprecates :method:`Bulk()` and its associated :doc:`methods `. * - :method:`db.collection.deleteMany()` - Equivalent to :method:`db.collection.remove()`. * - :method:`db.collection.deleteOne()` - Equivalent to :method:`db.collection.remove()` with the ``justOne`` set to true; i.e. :method:`db.collection.remove( \, true ) ` or :method:`db.collection.remove( \, { justOne: true } ) `. * - :method:`db.collection.findOneAndDelete()` - Equivalent to :method:`db.collection.findAndModify()` method with ``remove`` set to true. * - :method:`db.collection.findOneAndReplace()` - Equivalent to :method:`db.collection.findAndModify()` method with ``update`` set to a replacement document. * - :method:`db.collection.findOneAndUpdate()` - Equivalent to :method:`db.collection.findAndModify()` method with ``update`` set to a document that specifies modifications using :doc:`update operators `. * - :method:`db.collection.insertMany()` - Equivalent to :method:`db.collection.insert()` method with an array of documents as the parameter. * - :method:`db.collection.insertOne()` - Equivalent to :method:`db.collection.insert()` method with a single document as the parameter. * - :method:`db.collection.replaceOne()` - Equivalent to :method:`db.collection.update( \, \ ) ` method with a replacement document as the ```` parameter. * - :method:`db.collection.updateMany()` - Equivalent to :method:`db.collection.update( \, \, { multi: true, ... }) ` method with an ```` document that specifies modifications using :doc:`update operators ` and the ``multi`` option set to true. * - :method:`db.collection.updateOne()` - Equivalent to :method:`db.collection.update( \, \ ) ` method with an ```` document that specifies modifications using :doc:`update operators `. WiredTiger and ``fsyncLock`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 3.2, the WiredTiger storage engine supports the :dbcommand:`fsync` command with the ``lock`` option or the :binary:`~bin.mongo` shell method :method:`db.fsyncLock()`. That is, for the WiredTiger storage engine, these operations can guarantee that the data files do not change, ensuring consistency for the purposes of creating backups. .. comment: Refer DOCS-4751 as well as an audit to see the pages to update in 3.2 manual. You must do an audit. Platform Support ~~~~~~~~~~~~~~~~ Starting in 3.2, 32-bit binaries are deprecated and will be unavailable in future releases. .. include:: /includes/fact-installation-rhel5.rst ``$type`` Operator Accepts String Aliases ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :query:`$type` operator accepts string aliases for the BSON types in addition to the numbers corresponding to the BSON types. ``explain()`` Support for ``distinct()`` Operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :method:`db.collection.explain()` adds support for :method:`db.collection.distinct()` method. For more information, see :method:`db.collection.explain()`. ``explain`` Support for ``findAndModify`` and ``distinct`` Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :dbcommand:`explain` adds support for the :dbcommand:`distinct` and :dbcommand:`findAndModify` commands. For more information, see :dbcommand:`explain`. Deprecation of the HTTP Interface ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in 3.2, MongoDB deprecates its HTTP interface. ``keysExamined`` Count Includes the Last Scanned Key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For ``explain`` operations run in ``executionStats`` or ``allPlansExecution`` mode, the :doc:`explain output ` contains the ``keysExamined`` statistic, representing the number of index keys examined during index scans. Prior to 3.2, ``keysExamined`` count in some queries did not include the last scanned key. As of 3.2 this error has been corrected. For more information, see :data:` ~explain.executionStats.executionStages.inputStage.keysExamined`. The diagnostic logs and the system profiler report on this statistic. .. _3.2-relnotes-2dsphere-index: Geospatial Optimization ~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 introduces version 3 of :doc:`2dsphere indexes `, which index :doc:`GeoJSON geometries ` at a finer gradation. The new version improves performance of :doc:`2dsphere index ` queries over smaller regions. In addition, for both :doc:`2d indexes ` and :doc:`2dsphere indexes `, the performance of geoNear queries has been improved for dense datasets. .. seealso:: :ref:`3.2-2dsphere-index-compatibility` .. _3.2-diagnostic-data-capture: Diagnostic Data Capture ~~~~~~~~~~~~~~~~~~~~~~~ To facilitate analysis of the MongoDB server behavior by MongoDB engineers, MongoDB 3.2 introduces a diagnostic data collection mechanism for logging server statistics to diagnostic files at periodic intervals. By default, the mechanism captures data at 1 second intervals. To modify the interval, see :parameter:`diagnosticDataCollectionPeriodMillis`. MongoDB creates a ``diagnostic.data`` directory under the :binary:`~bin.mongod` instance's ``--dbpath`` or :setting:`storage.dbPath`. The diagnostic data is stored in files under this directory. The maximum size of the diagnostic files is configurable with the :parameter:`diagnosticDataCollectionFileSizeMB`, and the maximum size of the ``diagnostic.data`` directory is configurable with :parameter:`diagnosticDataCollectionDirectorySizeMB`. The default values for the capture interval and the maximum sizes are chosen to provide useful data to MongoDB engineers with minimal impact on performance and storage size. Typically, these values will only need modifications as requested by MongoDB engineers for specific diagnostic purposes. Write Concern ~~~~~~~~~~~~~ - For replica sets using :rsconf:`protocolVersion: 1 `, secondaries acknowledge write operations after the secondary members have written to their respective on-disk :doc:`journals `, regardless of the :ref:`j ` option. - For replica sets using :rsconf:`protocolVersion: 1 `, :writeconcern:`w: "majority" <"majority">` implies :ref:`j: true `. - .. include:: /includes/note-write-concern-journaled-replication.rst ``journalCommitInterval`` for WiredTiger ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 3.2 adds support for specifying the journal commit interval for the WiredTiger storage engine. See :option:`--journalCommitInterval ` option. In previous versions, the option is applicable to MMAPv1 storage engine only. For the corresponding configuration file setting, MongoDB 3.2 adds the :setting:`storage.journal.commitIntervalMs` setting and deprecates :setting:`storage.mmapv1.journal.commitIntervalMs`. The deprecated :setting:`storage.mmapv1.journal.commitIntervalMs` setting acts as an alias to the new :setting:`storage.journal.commitIntervalMs` setting. Changes Affecting Compatibility ------------------------------- Some MongoDB 3.2 changes can affect compatibility and may require user actions. For a detailed list of compatibility changes, see :doc:`/release-notes/3.2-compatibility`. .. class:: hidden .. toctree:: /release-notes/3.2-compatibility Upgrade Process --------------- .. class:: hidden .. toctree:: /release-notes/3.2-upgrade /release-notes/3.2-downgrade See :doc:`/release-notes/3.2-upgrade` for full upgrade instructions. Known Issues in 3.2.1 --------------------- List of known issues in the 3.2.1 release: - Clients may fail to discover new primaries when clock skew between nodes is greater than ``electionTimeout``: :issue:`SERVER-21744` - ``fromMigrate`` flag never set for deletes in oplog: :issue:`SERVER-21678` - Running :dbcommand:`explain` with a :doc:`read preference ` in a v3.2 ``mongo`` shell connected to a v3.0 ``mongos`` or in a v3.0 ``mongo`` shell connected to a v3.0 ``mongos`` but with v3.2 shards is incompatible: :issue:`SERVER-21661` - Results of the connPoolStats command are no longer correct: :issue:`SERVER-21597` - ApplyOps background index creation may deadlock: :issue:`SERVER-21583` - Performance regression for ``w:majority`` writes with replica set protocolVersion 1: :issue:`SERVER-21581` - Performance regression on unicode-aware text processing logic (text index v3): :issue:`SERVER-19936` - Results from the :pipeline:`$indexStats` operator do not take into account queries which use the :pipeline:`$match` or :dbcommand:`mapReduce` functions: :issue:`SERVER-22048` Known Issues in 3.2.0 --------------------- List of known issues in the 3.2.0 release: - findAndModify operations not captured by the profiler: :issue:`SERVER-21772` - :dbcommand:`getMore` command does not set ``"nreturned"`` operation counter: :issue:`SERVER-21750` - Clients may fail to discover new primaries when clock skew between nodes is greater than ``electionTimeout``: :issue:`SERVER-21744` - ``fromMigrate`` flag never set for deletes in oplog: :issue:`SERVER-21678` - Running :dbcommand:`explain` with a :doc:`read preference ` in a v3.2 ``mongo`` shell connected to a v3.0 ``mongos`` or in a v3.0 ``mongo`` shell connected to a v3.0 ``mongos`` but with v3.2 shards is incompatible: :issue:`SERVER-21661` - Results of the connPoolStats command are no longer correct: :issue:`SERVER-21597` - ApplyOps background index creation may deadlock: :issue:`SERVER-21583` - Performance regression for ``w:majority`` writes with replica set protocolVersion 1: :issue:`SERVER-21581` - Performance regression on unicode-aware text processing logic (text index v3): :issue:`SERVER-19936` - Severe performance regression in insert workload under Windows with WiredTiger: :issue:`SERVER-21792` - Results from the :pipeline:`$indexStats` operator do not take into account queries which use the :pipeline:`$match` or :dbcommand:`mapReduce` functions: :issue:`SERVER-22048` Download -------- To download MongoDB 3.2, go to the `downloads page`_. .. _`downloads page`: http://www.mongodb.org/downloads .. seealso:: - `All Third Party License Notices `_. - `All JIRA issues resolved in 3.2 `_.