- Release Notes for MongoDB 3.2
- Minor Releases
- 3.2.22 - Dec 28, 2018
- 3.2.21 - Sep 7, 2018
- 3.2.20 - May 10, 2018
- 3.2.19 - Feb 6, 2018
- 3.2.18 - Nov 29, 2017
- 3.2.17 - Sept 28, 2017
- 3.2.16 - Jul 27, 2017
- 3.2.15 - Jul 5, 2017
- 3.2.14 -Jun 13, 2017
- 3.2.13 – May 1, 2017
- 3.2.12 – Feb 1, 2017
- 3.2.11 – Nov 18, 2016
- 3.2.10 – Sep 30, 2016
- 3.2.9 – Aug 16, 2016
- 3.2.8 – Jul 12, 2016
- 3.2.7 – Jun 7, 2016
- 3.2.6 – Apr 28, 2016
- 3.2.5 – Apr 14, 2016
- 3.2.4 – Mar 8, 2016
- 3.2.3 – Feb 17, 2016
- 3.2.2 – Feb 16, 2016
- 3.2.1 – Jan 12, 2016
- WiredTiger as Default
- Replication Election Enhancements
- Sharded Cluster Enhancements
- readConcern
- Partial Indexes
- Document Validation
- Aggregation Framework Enhancements
- MongoDB Tools Enhancements
- Encrypted Storage Engine
- Text Search Enhancements
- New Storage Engines
- General Enhancements
- Bit Test Query Operators
- SpiderMonkey JavaScript Engine
- mongo Shell and CRUD API
- WiredTiger and fsyncLock
- Platform Support
- $type Operator Accepts String Aliases
- explain() Support for distinct() Operation
- explain Support for findAndModify and distinct Commands
- Deprecation of the HTTP Interface
- keysExamined Count Includes the Last Scanned Key
- Geospatial Optimization
- Diagnostic Data Capture
- Write Concern
- journalCommitInterval for WiredTiger
- Changes Affecting Compatibility
- Upgrade Process
- Known Issues in 3.2.1
- Known Issues in 3.2.0
- Download
- Minor Releases
Release Notes for MongoDB 3.2
Dec 8, 2015
MongoDB 3.2 is now available. Key features include WiredTiger as thedefault storage engine, replication election enhancements, configservers as replica sets, readConcern
, and document validations.
OpsManager 2.0 is also available. See the Ops Manager documentation and the Ops Managerrelease notesfor more information.
Minor Releases
- 3.2 Changelog
- 3.2.22 Changelog
- 3.2.21 Changelog
- 3.2.20 Changelog
- 3.2.19 Changelog
- 3.2.18 Changelog
- 3.2.17 Changelog
- 3.2.16 Changelog
- 3.2.15 Changelog
- 3.2.14 Changelog
- 3.2.13 Changelog
- 3.2.12 Changelog
- 3.2.11 Changelog
- 3.2.10 Changelog
- 3.2.9 Changelog
- 3.2.8 Changelog
- 3.2.7 Changelog
- 3.2.6 Changelog
- 3.2.5 Changelog
- 3.2.4 Changelog
- 3.2.3 Changelog
- 3.2.1 Changelog
3.2.22 - Dec 28, 2018
- SERVER-38425 Oplog Visibility Query is a collection scan in 3.2.21
- 3.2.22 Changelog
- All JIRA issues closed in 3.2.22%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.22%27)
3.2.21 - Sep 7, 2018
- SERVER-32999: Platform Support: remove Debian 7.
- SERVER-36010 Change log messages for Windows stacktraces to use error() or severe() rather than log().
- SERVER-30724 Initial sync might miss ops that were in flight when it started.
- 3.2.21 Changelog
- All JIRA issues closed in 3.2.21%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.21%27)
3.2.20 - May 10, 2018
- SERVER-32241: applyOps reports success even when a nestedapplyOps fails.
- SERVER-32923: Platform Support: remove SLES11 builds.
- SERVER-31535: Platform Support: remove Ubuntu 12.04 builds.
- 3.2.20 Changelog
- All JIRA issues closed in 3.2.20%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.20%27)
3.2.19 - Feb 6, 2018
- SERVER-30189: Reduce calls to allocator for large $in expressions
- SERVER-30853: Update Mongod init scripts to set unlimited locked memory
- SERVER-32001: Unindexing a key in a partial unique index may cause server crash
- SERVER-32048: Updates using a numeric path component may cause index entries not to be created
- 3.2.19 Changelog
- All JIRA issues closed in 3.2.19%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.19%27)
3.2.18 - Nov 29, 2017
- SERVER-29287: Upgrade pcre to 8.41
- SERVER-31101: WT table not dropped after collection is dropped due to long-running OperationContext
- SERVER-31149: Enable recovery progress messages
- 3.2.18 Changelog
- All JIRA issues closed in 3.2.18%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.18%27)
3.2.17 - Sept 28, 2017
Issues fixed:
- SERVER-30636: RangeDeleter assert failed because of replication lag
- SERVER-30943: Segmentation fault on attempt to access an invalidated BSON Object in JS scope
- WT-3327: Checkpoints can hang if time runs backward
- 3.2.17 Changelog
- All JIRA issues closed in 3.2.17%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.17%27)
3.2.16 - Jul 27, 2017
Issues fixed:
- SERVER-26952: Cache SCRAM-SHA-1 ClientKey
- SERVER-28578: When doing an upgrade from PV0 to PV1, we should not return from the reconfigure until the lastVote document is written.
- SERVER-29568: Enable configuration of OpenSSL cipher suite via setParameter
- 3.2.16 Changelog
- All JIRA issues closed in 3.2.16%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.16%27)
3.2.15 - Jul 5, 2017
Issues fixed:
- SERVER-29237: Add ShardingTaskExecutorPoolMaxConnecting flag for
mongos
. - SERVER-29850: Access violation due to a bug in internal page splitting in WiredTiger.
- WT-3362: Cursor opens should never block for the duration of a checkpoint.
- 3.2.15 Changelog
- All JIRA issues closed in 3.2.15%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.15%27)
3.2.14 -Jun 13, 2017
Issues fixed:
- SERVER-26452:
renameCollection
should handle write conflicts. - SERVER-29365: No-op
applyOps
does not wait for majority writeConcern before returning. - SERVER-28014: When ssl mode is
preferSSL
, should logconnections that do not use SSL. - 3.2.14 Changelog
- All JIRA issues closed in 3.2.14%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.14%27)
3.2.13 – May 1, 2017
Issues fixed:
- SERVER-3181: Add
nameOnly
option to listDatabases toonly get db names, not size info. - SERVER-21818: Capture system metrics in FTDC
- SERVER-25318: Limit total memory utilization for bulk index builds
- 3.2.13 Changelog
- All JIRA issues closed in 3.2.13%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.13%27)
3.2.12 – Feb 1, 2017
Issues fixed:
- SERVER-27125 Arbiters in
pv1
should vote no in electionsif they can see a healthy primary of equal or greater priority to thecandidate. - SERVER-25012:
createIndex
blocks for durationof checkpoint while holding locks. - SERVER-25865:
$group
operation is slow onWindows. - 3.2.12 Changelog
- All JIRA issues closed in 3.2.12%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.12%27)
3.2.11 – Nov 18, 2016
Issues fixed:
- SERVER-26182: In a mixed version replica set with v3.2 andv3.0 members, a sync of a v3.2 member from a v3.0 member can resultin a query response that exceed 16 MB BSON size limit and crash thev3.2 member.
- SERVER-24662: Upgrade to Perl compatible regular expressions(PCRE 8.39).
- SERVER-26652 Invalid definitions in
systemd
configurationfor Debian. - SERVER-24386:
killCursor
operation during aggregationpipeline can cause segmentation fault. - 3.2.11 Changelog
- All JIRA issues closed in 3.2.11%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.11%27)
3.2.10 – Sep 30, 2016
Issues fixed:
- SERVER-25974: When WT cache utilization is full, applicationthreads can stall for an extended period of time.
- SERVER-20306: MongoDB with WiredTiger may experienceexcessive memory fragmentation, leading to swapping and/orout-of-memory errors.
- SERVER-16801: When updating a field of one numerical type tothe same number of different numerical type, update operationconsiders it as a noop.
- 3.2.10 Changelog
- All JIRA issues closed in 3.2.10%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.10%27)
3.2.9 – Aug 16, 2016
Issues fixed:
- SERVER-7285: Support systemd in future compatible Ubuntu distributions.
- WT-2798: Create operations on WiredTiger when journaling is disabled maylead to inconsistent data in the event of a crash.
- SERVER-17856: On
mongod
instances, users can runcurrentOp
andkillOp
on own operations. - 3.2.9 Changelog
- All JIRA issues closed in 3.2.9%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.9%27)
3.2.8 – Jul 12, 2016
Issues fixed:
- SERVER-18329: Debian 8(Jessie) packages.
- SERVER-24580: Improve performance when WiredTiger cache isfull.
- WT-2696: Race condition on unclean shutdown may miss logrecords with large updates.
- WT-2706: Race condition on log file switch can cause missinglog records.
- 3.2.8 Changelog
- All JIRA issues closed in 3.2.8%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.2.8%27)
3.2.7 – Jun 7, 2016
Issues fixed:
- SERVER-24054: JS segmentation fault on load of certain NaNs.
- SERVER-24058: Connection pool asio doesn’t honor setup timeouts.
- SERVER-24117: Mongo binaries ELF stack has become executable.
- 3.2.7 Changelog
- All JIRA issues closed in 3.2.7%20AND%20fixVersion%20%3D%203.2.7%20AND%20resolution%20%3D%20Fixed%20)
3.2.6 – Apr 28, 2016
- First production release of the in-memory storage engine.
Issues fixed:
- SERVER-22970: Background index build may result in extra indexkey entries that do not correspond to indexed documents.
- SERVER-22043:
mongo
shell methodcount()
ignores read preference. - 3.2.6 Changelog
- All JIRA issues closed in 3.2.6%20AND%20fixVersion%20%3D%203.2.6%20AND%20resolution%20%3D%20Fixed%20)
3.2.5 – Apr 14, 2016
Issues fixed:
- SERVER-22964: IX GlobalLock held while waiting forWiredTiger cache eviction.
- SERVER-22831: Low query rate with heavy cache pressureand an idle collection.
- SERVER-21681: Include index size stats for in-memory storageengine.
- 3.2.5 Changelog
- All JIRA issues closed in 3.2.5%20AND%20fixVersion%20%3D%203.2.5%20AND%20resolution%20%3D%20Fixed%20)
3.2.4 – Mar 8, 2016
Issues fixed:
- SERVER-22495, SERVER-22728: Update optime whenrunning with journaling disabled.
- SERVER-22269: Have read concern
majority
reflectjournaled state on the primary - SERVER-22683:
replication.enableMajorityReadConcern
ignores actualsetting value and instead impliestrue
. - SERVER-22043:
count()
method in themongo
shell does not apply the read preferences. - 3.2.4 Changelog
- All JIRA issues closed in 3.2.4%20AND%20fixVersion%20%3D%203.2.4%20AND%20resolution%20%3D%20Fixed%20)
3.2.3 – Feb 17, 2016
Issues fixed:
- SERVER-22261: For MMAPv1 journaling, the “last sequencenumber” file (
lsn
file) may be ahead of what is synced to thedata files. - SERVER-22167: In some cases, insert operations fails to addthe
_id
field to large documents. - SERVER-22456: Increased timeout for querying oplog to 1minute.
- 3.2.3 Changelog
- All JIRA issues closed in 3.2.3%20AND%20fixVersion%20%3D%203.2.3%20AND%20resolution%20%3D%20Fixed%20)
3.2.2 – Feb 16, 2016
Replaced by MongoDB 3.2.3. Users wishing torun MongoDB 3.2 should skip 3.2.2 and upgrade directly to 3.2.3.
3.2.1 – Jan 12, 2016
Issues fixed:
- SERVER-21868: During a regular shutdown of a replica set,secondaries may mark certain replicated but yet to be appliedoperations as successfully applied.
- SERVER-20262: Improve insert workload performance withWiredTiger on Windows.
- SERVER-21366: Long-running transactions during chunk moves.
- 3.2.1 Changelog
- All JIRA issues closed in 3.2.1%20AND%20fixVersion%20%3D%203.2.1%20AND%20resolution%20%3D%20Fixed%20)
WiredTiger as Default
Starting in 3.2, MongoDB uses the WiredTiger as the default storageengine.
To specify the MMAPv1 storage engine, you must specify the storageengine setting either:
- On the command line with the
—storageEngine
option:
- mongod --storageEngine mmapv1
- Or in a configuration file,using the
storage.engine
setting:
- storage:
- engine: mmapv1
Note
For existing deployments, if you do not specify the—storageEngine
or the storage.engine
setting,MongoDB 3.2 can automatically determine the storage engineused to create the data files in the —dbpath
orstorage.dbPath
.
If specifying —storageEngine
or storage.engine
,mongod
will not start if dbPath
contains data filescreated by a storage engine other than the one specified.
See also
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 WiredTiger and Memory Use.
WiredTiger Journal Write Frequency
MongoDB 3.2 configures WiredTiger to write to the journal files atevery 50 milliseconds. This is in addition to the existing journal writeintervals and conditions. For more information, see Journaling Process.
Replication Election Enhancements
Starting in MongoDB 3.2, MongoDB reduces replica set failover timeand accelerates the detection of multiple simultaneous primaries.
As part of this enhancement, MongoDB introduces a version 1 of thereplication protocol. New replica sets will, by default, useprotocolVersion: 1
. Previous versions ofMongoDB use version 0 of the protocol.
In addition, MongoDB introduces a new replica set configuration optionelectionTimeoutMillis
.electionTimeoutMillis
specifies the time limit inmilliseconds for detecting when a replica set’s primary is unreachable.
electionTimeoutMillis
only applies if using theversion 1 of the replication protocol
.
See also
Sharded Cluster Enhancements
MongoDB 3.2 deprecates the use of three mirrored mongod
instances for config servers.
Instead, starting in 3.2, the config servers for a sharded cluster can bedeployed as a replica set. The replica set config servers must run theWiredTiger storage engine.
This change improves consistency across the config servers, sinceMongoDB can take advantage of the standard replica set read and writeprotocols for sharding config data. In addition, this allows a shardedcluster to have more than 3 config servers since a replica set can haveup to 50 members.
For more information, see Config Servers.To deploy a new sharded cluster with replica set config servers,see Deploy a Sharded Cluster.
MongoDB 3.2 deprecates the use of master-slave replication forcomponents of sharded clusters.
Starting in 3.2, mongos
, during its startup, will continueto try to contact the config servers until one becomes available. Inprevious versions, mongos
, during its startup, would shutdown if it could not find a config server.
readConcern
MongoDB 3.2 introduces the readConcern
query option for replica sets and replicaset shards. For the WiredTiger storage engine, the readConcern
option allows clients tochoose a level of isolation for their reads. You can specify areadConcern
of "majority"
to read data that has been written toa majority of nodes and thus cannot be rolled back. By default, MongoDBuses a readConcern
of "local"
to return the most recent dataavailable to the node at the time of the query, even if the data hasnot been persisted to a majority of nodes and may be rolled back. Withthe MMAPv1 storage engine, you can only specify areadConcern
of "local"
.
readConcern
requires MongoDB drivers updated for MongoDB 3.2.
For details on readConcern
, including operations that support theoption, see Read Concern.
Partial Indexes
MongoDB 3.2 provides the option to create indexes that only indexthe documents in a collection that meet a specified filter expression.By indexing a subset of the documents in a collection, partial indexeshave lower storage requirements and reduced performance costs for indexcreation and maintenance. You can specify a partialFilterExpression
option for all MongoDB index types.
The partialFilterExpression
option accepts a document that specifies thecondition using:
- equality expressions (i.e.
field: value
or using the$eq
operator), $exists: true
expression,$gt
,$gte
,$lt
,$lte
expressions,$type
expressions,$and
operator at the top-level only
For details, see Partial Indexes.
Document Validation
Starting in 3.2, MongoDB provides the capability to validate documentsduring updates and insertions. Validation rules are specified on aper-collection basis.
To specify document validation on a new collection, use the newvalidator
option in the db.createCollection()
method. Toadd document validation to an existing collection, use the newvalidator
option in the collMod
command. For moreinformation, see Schema Validation.
To view the validation specifications for a collection, use thedb.getCollectionInfos()
method.
The following commands can bypass validation per operation using thenew option bypassDocumentValidation
:
applyOps
commandfindAndModify
command anddb.collection.findAndModify()
methodmapReduce
command anddb.collection.mapReduce()
methodinsert
commandupdate
command$out
for theaggregate
command anddb.collection.aggregate()
method
For deployments that have enabled access control, you must havebypassDocumentValidation
action. The built-in rolesdbAdmin
and restore
provide this action.
Aggregation Framework Enhancements
MongoDB introduces:
- New stages, accumulators, and expressions.
- Availability of accumulator expressions in
$project
stage. - Performance improvements onsharded clusters.
New Aggregation Stages
Stage | Description | Syntax |
---|---|---|
$sample | Randomly selects N documents from its input. | { $sample: { size: <positive integer> } } |
$indexStats | Returns statistics on index usage. | { $indexStats: { } } |
$lookup | Performs a left outer join with another collection. |
|
New Accumulators for $group Stage
Accumulator | Description | Syntax |
---|---|---|
$stdDevSamp | Calculates standard deviation. | { $stdDevSamp: <array> } |
$stdDevPop | Calculates population standard deviation. | { $stdDevPop: <array> } |
New Aggregation Arithmetic Operators
Operator | Description | Syntax |
---|---|---|
$sqrt | Calculates the square root. | { $sqrt: <number> } |
$abs | Returns the absolute value of a number. | { $abs: <number> } |
$log | Calculates the log of a number in the specified base. | { $log: [ <number>, <base> ] } |
$log10 | Calculates the log base 10 of a number. | { $log10: <number> } |
$ln | Calculates the natural log of a number. | { $ln: <number> } |
$pow | Raises a number to the specified exponent. | { $pow: [ <number>, <exponent> ] } |
$exp | Raises e to the specified exponent. | { exp: <number> } |
$trunc | Truncates a number to its integer. | { $trunc: <number> } |
$ceil | Returns the smallest integer greater than or equal to thespecified number. | { $ceil: <number> } |
$floor | Returns the largest integer less than or equal to the specifiednumber. | { floor: <number> } |
New Aggregation Array Operators
Operator | Description | Syntax |
---|---|---|
$slice | Returns a subset of an array. | { $slice: [ <array>, <n> ] } or{ $slice: [ <array>, <position>, <n> ] } |
$arrayElemAt | Returns the element at the specified array index. | { $arrayElemAt: [ <array>, <idx> ] } |
$concatArrays | Concatenates arrays. |
|
$isArray | Determines if the operand is an array. | { $isArray: [ <expression> ] } |
$filter | Selects a subset of the array based on the condition. |
|
Accumulator Expression Availability
Starting in version 3.2, the following accumulator expressions,previously only available in the $group
stage, are now alsoavailable in the $project
stage:
When used as part of the $project
stage, these accumulatorexpressions can accept either:
- A single argument:
<accumulator> : <arg>
- Multiple arguments:
<accumulator> : [ <arg1>, <arg2>, … ]
General Enhancements
In MongoDB 3.2,
$project
stage supports using the squarebrackets[]
to directly create new array fields. For an example,see Project New Array Fields.MongoDB 3.2 introduces the
minDistance
option for the$geoNear
stage.$unwind
stage no longer errors on non-array operand. Ifthe operand does not resolve to an array but is not missing, null, oran empty array,$unwind
treats the operand as a singleelement array.
$unwind
stage can:
- include the array index of the array element in the output byspecifying a new option
includeArrayIndex
in the stagespecification. - output those documents where the array field is missing, null or anempty array by specifying a new option
preserveNullAndEmptyArrays
in the stage specification.To support these new features,$unwind
can now take analternate syntax. See$unwind
for details.
Optimization
Indexes can cover aggregation operations.
MongoDB improves the overall performance of the pipelinein large sharded clusters.
If the pipeline starts with an exact $match
on a shard key,the entire pipeline runs on the matching shard only. Previously, thepipeline would have been split, and the work of merging it would haveto be done on the primary shard.
For aggregation operations that run on multiple shards, if theoperations do not require running on the database’s primary shard,these operations can route the results to any shard to merge theresults and avoid overloading the primary shard for that database.Aggregation operations that require running on the database’s primaryshard are the $out
stage and $lookup
stage.
Compatibility
For compatibility changes, see Aggregation Compatibility Changes.
MongoDB Tools Enhancements
mongodump
andmongorestore
add support forarchive files and standard output/input streams with a new—archive
option. This enhancement allows for the streaming ofthe dump data over a network device via a pipe. For examples, seemongodump
andmongorestore
add support forcompressed data dumps with a new—gzip
option. This enhancementreduces storage space for the dump files. For examples, see:
Encrypted Storage Engine
Enterprise Feature
Available in MongoDB Enterprise only.
Important
Available for the WiredTiger Storage Engine only.
Encryption at rest, when used in conjunction with transport encryptionand good security policies that protect relevant accounts, passwords,and encryption keys, can help ensure compliance with security andprivacy standards, including HIPAA, PCI-DSS, and FERPA.
MongoDB Enterprise 3.2 introduces a native encryption option for theWiredTiger storage engine. This feature allows MongoDB to encrypt datafiles such that only parties with the decryption key can decode andread the data. For detail, see Encrypted Storage Engine.
Text Search Enhancements
text Index Version 3
MongoDB 3.2 introduces a version 3 of the text index. Key features of the new version of the index are:
- Improved case insensitivity.
- Diacritic insensitivity.
- Additional delimiters for tokenization.
Starting in MongoDB 3.2, version 3 is the default version for newtext indexes.
See also
Text Index Version 3 Compatibility
$text Operator Enhancements
The $text
operator adds support for:
- case sensitive text searchwith the new
$caseSensitive
option, and - diacritic sensitive text search with the new
$diacriticSensitive
option.
For more information and examples, see the $text
operatorreference sections Case Insensitivity andDiacritic Insensitivity.
Support for Additional Languages
Enterprise Feature
Available in MongoDB Enterprise only.
Starting in 3.2, MongoDB Enterprise provides support for thefollowing languages: Arabic, Farsi (specifically Dari and IranianPersian dialects), Urdu, Simplified Chinese, and Traditional Chinese.
For details, see Text Search with Basis Technology Rosette Linguistics Platform.
New Storage Engines
inMemory Storage Engine
Enterprise Feature
Available in MongoDB Enterprise only.
MongoDB Enterprise 3.2 provides an in-memory storage engine. Other than somemetadata, the in-memory storage engine does not maintain any on-disk data. Byavoiding disk I/O, the in-memory storage engine allows for more predictablelatency of database operations.
To select this storage engine, specify
inMemory
for the—storageEngine
option or thestorage.engine
setting.—dbpath
. Although the in-memory storage engine does not writedata to the filesystem, it maintains in the—dbpath
smallmetadata files and diagnostic data as well temporary files for buildinglarge indexes.
The inMemory
storage engine uses document-level locking. For more details,see In-Memory Storage Engine.
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 theneed 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—storageEngine
option or thestorage.engine
setting.—dbpath
. Although the for-test storage engine does not write data tothe filesystem, it maintains small metadata files in the—dbpath
.
The ephemeralForTest
storage engine uses collection-level locking.
General Enhancements
Bit Test Query Operators
MongoDB 3.2 provides new query operators to test bit values:
SpiderMonkey JavaScript Engine
MongoDB 3.2 uses SpiderMonkey as the JavaScript engine for themongo
shell and mongod
server. SpiderMonkeyprovides support for additional platforms and has an improved memorymanagement model.
This change affects all JavaScript behavior including the commandsmapReduce
, group, and the query operator$where
; however, this change should be completelytransparent to the user.
See also
SpiderMonkey Compatibility Changes
mongo Shell and CRUD API
To provide consistency with the MongoDB drivers’ CRUD(Create/Read/Update/Delete) API, the mongo
shell introducesadditional CRUD methods that are consistent with the drivers’ CRUD API:
New API | Description |
---|---|
db.collection.bulkWrite() | Equivalent to initializing Bulk() operations builder,using Bulk methods to add operations, andrunning Bulk.execute() to execute the operations.MongoDB 3.2 deprecates Bulk() and its associatedmethods. |
db.collection.deleteMany() | Equivalent to db.collection.remove() . |
db.collection.deleteOne() | Equivalent to db.collection.remove() with thejustOne set to true; i.e.db.collection.remove( <query>, true ) ordb.collection.remove( <query>, { justOne: true } ) . |
db.collection.findOneAndDelete() | Equivalent to db.collection.findAndModify() methodwith remove set to true. |
db.collection.findOneAndReplace() | Equivalent to db.collection.findAndModify() methodwith update set to a replacement document. |
db.collection.findOneAndUpdate() | Equivalent to db.collection.findAndModify() methodwith update set to a document that specifies modificationsusing update operators. |
db.collection.insertMany() | Equivalent to db.collection.insert() methodwith an array of documents as the parameter. |
db.collection.insertOne() | Equivalent to db.collection.insert() methodwith a single document as the parameter. |
db.collection.replaceOne() | Equivalent to db.collection.update( <query>,<update> ) method with a replacementdocument as the <update> parameter. |
db.collection.updateMany() | Equivalent to db.collection.update( <query>,<update>, { multi: true, … }) method with an <update> document that specifiesmodifications using update operators and the multi option set totrue. |
db.collection.updateOne() | Equivalent to db.collection.update( <query>,<update> ) method with an<update> document that specifies modifications usingupdate operators. |
WiredTiger and fsyncLock
Starting in MongoDB 3.2, the WiredTiger storage engine supports thefsync
command with the lock
option or themongo
shell method db.fsyncLock()
. That is, forthe WiredTiger storage engine, these operations can guarantee that thedata files do not change, ensuring consistency for the purposes ofcreating backups.
Platform Support
Starting in 3.2, 32-bit binaries are deprecated and will beunavailable in future releases.
MongoDB 3.2 also deprecates support for Red Hat Enterprise Linux 5.
$type Operator Accepts String Aliases
$type
operator accepts string aliases for the BSON types inaddition to the numbers corresponding to the BSON types.
explain() Support for distinct() Operation
db.collection.explain()
adds support fordb.collection.distinct()
method. For more information, seedb.collection.explain()
.
explain Support for findAndModify and distinct Commands
explain
adds support for the distinct
andfindAndModify
commands. For more information, seeexplain
.
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
orallPlansExecution
mode, the 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 includethe last scanned key. As of 3.2 this error has been corrected. For moreinformation, see :data:~explain.executionStats.executionStages.inputStage.keysExamined
.
The diagnostic logs and the system profiler report on this statistic.
Geospatial Optimization
MongoDB 3.2 introduces version 3 of 2dsphereindexes, which index GeoJSON geometries at a finer gradation. The new version improvesperformance of 2dsphere index queries oversmaller regions. In addition, for both 2d indexes and2dsphere indexes, the performance ofgeoNear queries has been improved for dense datasets.
See also
2dsphere Index Version 3 Compatibility
Diagnostic Data Capture
To facilitate analysis of the MongoDB server behavior by MongoDBengineers, MongoDB 3.2 introduces a diagnostic data collectionmechanism for logging server statistics to diagnostic files at periodicintervals. By default, the mechanism captures data at 1 secondintervals. To modify the interval, seediagnosticDataCollectionPeriodMillis
.
MongoDB creates a diagnostic.data
directory under themongod
instance’s —dbpath
or storage.dbPath
.The diagnostic data is stored in files under this directory.
The maximum size of the diagnostic files is configurable with thediagnosticDataCollectionFileSizeMB
, and the maximum sizeof the diagnostic.data
directory is configurable withdiagnosticDataCollectionDirectorySizeMB
.
The default values for the capture interval and the maximum sizes arechosen to provide useful data to MongoDB engineers with minimal impacton performance and storage size. Typically, these values will only needmodifications as requested by MongoDB engineers for specific diagnosticpurposes.
Write Concern
- For replica sets using
protocolVersion: 1
, secondaries acknowledge write operations after thesecondary members have written to their respective on-diskjournals, regardless of the joption. - For replica sets using
protocolVersion: 1
,w: "majority"
implies j: true. - With
j: true
, MongoDB returns only after therequested number of members, including the primary, have written to thejournal. Previouslyj: true
write concern in areplica set only requires the primary to write to the journal,regardless of the w:write concern.
journalCommitInterval for WiredTiger
MongoDB 3.2 adds support for specifying the journal commit interval forthe WiredTiger storage engine. See —journalCommitInterval
option. In previous versions, the option is applicable to MMAPv1storage engine only.
For the corresponding configuration file setting, MongoDB 3.2 adds thestorage.journal.commitIntervalMssetting and deprecates storage.mmapv1.journal.commitIntervalMs. The deprecated storage.mmapv1.journal.commitIntervalMs setting acts as an alias to the newstorage.journal.commitIntervalMssetting.
Changes Affecting Compatibility
Some MongoDB 3.2 changes can affect compatibility and may require useractions. For a detailed list of compatibility changes, seeCompatibility Changes in MongoDB 3.2.
- Compatibility Changes in MongoDB 3.2
Upgrade Process
- Upgrade MongoDB to 3.2
- Downgrade MongoDB from 3.2
See Upgrade MongoDB to 3.2 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 betweennodes is greater than
electionTimeout
: SERVER-21744 fromMigrate
flag never set for deletes in oplog: SERVER-21678- Running
explain
with a read preference in a v3.2mongo
shellconnected to a v3.0mongos
or in a v3.0mongo
shell connectedto a v3.0mongos
but with v3.2 shards is incompatible:SERVER-21661 - Results of the connPoolStats command are no longer correct: SERVER-21597
- ApplyOps background index creation may deadlock: SERVER-21583
- Performance regression for
w:majority
writes with replica setprotocolVersion 1: SERVER-21581 - Performance regression on unicode-aware text processing logic (textindex v3): SERVER-19936
- Results from the
$indexStats
operator do not take into account querieswhich use the$match
ormapReduce
functions: 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: SERVER-21772
getMore
command does not set"nreturned"
operationcounter: SERVER-21750- Clients may fail to discover new primaries when clock skew betweennodes is greater than
electionTimeout
: SERVER-21744 fromMigrate
flag never set for deletes in oplog: SERVER-21678- Running
explain
with a read preference in a v3.2mongo
shellconnected to a v3.0mongos
or in a v3.0mongo
shell connectedto a v3.0mongos
but with v3.2 shards is incompatible:SERVER-21661 - Results of the connPoolStats command are no longer correct: SERVER-21597
- ApplyOps background index creation may deadlock: SERVER-21583
- Performance regression for
w:majority
writes with replica setprotocolVersion 1: SERVER-21581 - Performance regression on unicode-aware text processing logic (textindex v3): SERVER-19936
- Severe performance regression in insert workload under Windows withWiredTiger: SERVER-21792
- Results from the
$indexStats
operator do not take into account querieswhich use the$match
ormapReduce
functions: SERVER-22048
Download
To download MongoDB 3.2, go to the downloads page.
See also