- Release Notes for MongoDB 3.4
- Minor Releases
- 3.4.23 - Sep 16, 2019
- 3.4.22 - Aug 6, 2019
- 3.4.21 - Jun 14, 2019
- 3.4.20 - Mar 13, 2019
- 3.4.19 - Jan 28, 2019
- 3.4.18 - Nov 7, 2018
- 3.4.17 - Sep 7, 2018
- 3.4.16 - Jul 10, 2018
- 3.4.15 - May 16, 2018
- 3.4.14 - March 20, 2018
- 3.4.13 - Feb 10, 2018
- 3.4.12 - Feb 8, 2018
- 3.4.11 - Jan 31, 2018
- 3.4.10 - Oct 31, 2017
- 3.4.9 - Sept 11, 2017
- 3.4.7 – Aug 8, 2017
- 3.4.6 – Jul 5, 2017
- 3.4.5 – Jun 14, 2017
- 3.4.4 – Apr 21, 2017
- 3.4.3 – Mar 28, 2017
- 3.4.2 – Feb 1, 2017
- 3.4.1 – Dec 20, 2016
- Sharded Cluster
- Replica Set
- Decimal Type
- Aggregation
- New Aggregation Stage for Recursive Search
- New Aggregation Stages for Faceted Search
- New Aggregation Stages to Facilitate Reshaping Documents
- New Aggregation Stage to Count
- New Aggregation Array Operators
- New Aggregation String Operators
- New Aggregation Control Flow Expression
- New Date Aggregation Operators
- New Monitoring Aggregation Sources
- New Type Operator
- Additional Changes
- Collation and Case-Insensitive Indexes
- Views
- Security Enhancement
- MongoDB Tools
- General Enhancements
- Platform Support
- MongoDB Enterprise Features
- Changes Affecting Compatibility
- Upgrade Procedures
- Download
- Known Issues in 3.4.0
- Minor Releases
Release Notes for MongoDB 3.4
MongoDB 3.4 Released Nov 29, 2016
MongoDB 3.4 is now available. Key features include linearizable readconcerns, views, and collation.
OpsManager 3.4 is also available. See the Ops Manager documentation and the Ops Managerrelease notesfor more information.
Minor Releases
- 3.4 Changelog
- 3.4.23 Changelog
- 3.4.22 Changelog
- 3.4.21 Changelog
- 3.4.20 Changelog
- 3.4.19 Changelog
- 3.4.18 Changelog
- 3.4.17 Changelog
- 3.4.16 Changelog
- 3.4.15 Changelog
- 3.4.14 Changelog
- 3.4.13 Changelog
- 3.4.12 Changelog
- 3.4.11 Changelog
- 3.4.10 Changelog
- 3.4.9 Changelog
- 3.4.7 Changelog
- 3.4.6 Changelog
- 3.4.5 Changelog
- 3.4.4 Changelog
- 3.4.3 Changelog
- 3.4.2 Changelog
- 3.4.1 Changelog
3.4.23 - Sep 16, 2019
Issues fixed:
- SERVER-36394: mongos should reset chunk size trackinginformation when autosplit = false or splitvector returns too fewsplit points
- SERVER-41829: findAndModify ignores filter expressions thatare not objects
- SERVER-42055: Only acquire a collection IX lock to write thelastVote document
- 3.4.23 Changelog
- All JIRA issues closed in 3.4.23%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.23%27)
3.4.22 - Aug 6, 2019
Issues fixed:
- SERVER-17010: Reduce file handle usage in File based Sorter.
- SERVER-38984: Attach IDs to users (CVE-2019-2386).
- 3.4.22 Changelog
- All JIRA issues closed in 3.4.22%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.22%27)
Note
Fixed issues include those that resolve the following CommonVulnerabilities and Exposures (CVEs):
- CVE-2019-2386 (See SERVER-38984)
- CVE-2019-2389 (See SERVER-40563)
- CVE-2019-2390 (See SERVER-42233)
3.4.21 - Jun 14, 2019
Issues fixed:
- SERVER-39820: Add the client IP address to the successful authentication log message
- SERVER-41213: Unique background index builds may produce inconsistent keys
- SERVER-37765: Platform Support: Remove Ubuntu 14.04
- SERVER-37774: Platform Support: Remove Enterprise Ubuntu 16.04 PPCLE
- WT-4615: Sync backup file before returning backup cursor
- 3.4.21 Changelog
- All JIRA issues closed in 3.4.21%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.21%27)
3.4.20 - Mar 13, 2019
Issues fixed:
- SERVER-39166: $graphLookup should force a pipeline to split in sharded cluster
- SERVER-39723: Change listIndexes command behavior to show in-progress index builds
- TOOLS-2158: mongodump failing on Windows with “error opening system CA store: Access is denied.”
- 3.4.20 Changelog
- All JIRA issues closed in 3.4.20%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.20%27)
3.4.19 - Jan 28, 2019
Issues fixed:
- SERVER-18985: setParameter should log at level 0
- SERVER-22766: Dynamic oplog sizing for WiredTiger nodes
- SERVER-33469: Make syslog log lines consistent with mongod log lines
- SERVER-37132: Negation of $in with regex can incorrectly plan from the cache, leading to missing query results
- SERVER-37182: Different values when referencing whole object vs. a field of that object after $arrayToObject
- SERVER-37616: Implement tuneable batch size for the rangedeleter
- 3.4.19 Changelog
- All JIRA issues closed in 3.4.19%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.19%27)
3.4.18 - Nov 7, 2018
Issues fixed:
- SERVER-25175: listIndexes shouldn’t include in-progress background indexes
- SERVER-35418: Allow specifying CAs for incoming and outgoing connections separately.
- SERVER-36944: applyOps does not permit unknown field names when creating a v:1 index.
- SERVER-37058: Update with numeric field names inside an array can cause validation to fail.
- 3.4.18 Changelog
- All JIRA issues closed in 3.4.18%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.18%27)
3.4.17 - Sep 7, 2018
Issues fixed:
- SERVER-33857 Missing log redaction due to confusion withCommand::redactForLogging().
- SERVER-34846 Covered index with collated field returnsincorrect result when collation not involved in match or sort.
- SERVER-36010 Change log messages for Windows stacktraces touse error() or severe() rather than log().
- SERVER-34558: Add SSL_version to client metadata logging.
- 3.4.17 Changelog
- All JIRA issues closed in 3.4.17%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.17%27)
3.4.16 - Jul 10, 2018
Issues fixed:
- SERVER-32999: Platform Support: Remove Debian 7 builds.
- SERVER-29301: Upgrade MozJS to ESR 45.9.0
- SERVER-5461: Add
syncSourceHost
field toreplSetGetStatus
output. - 3.4.16 Changelog
- All JIRA issues closed in 3.4.16%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.16%27)
3.4.15 - May 16, 2018
Issues fixed:
- SERVER-31535: Platform Support: remove Ubuntu 12.04 builds.
- SERVER-32923: Platform Support: remove SLES11 builds.
- SERVER-20056: Log a startup warning if wiredTigerCacheSizeGB is > 80% of RAM.
- SERVER-28981: Sharding balancer prefers shards in a specific order when moving chunks.
- 3.4.15 Changelog
- All JIRA issues closed in 3.4.15%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.15%27)
3.4.14 - March 20, 2018
Issues fixed:
- SERVER-28151: Authentication database should be synced firstduring an initial sync.
- SERVER-32886: Unnecessary sleeps during chunk migration.
- SERVER-32933: Allow
mongod
to start when unable to reachLDAP server. - 3.4.14 Changelog
- All JIRA issues closed in 3.4.14%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.14%27)
3.4.13 - Feb 10, 2018
Issues fixed:
- SERVER-33238: Prevent WiredTiger read ticket count from going negative.
- 3.4.13 Changelog
- All JIRA issues closed in 3.4.13%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.13%27)
3.4.12 - Feb 8, 2018
Issues fixed:
- SERVER-31437: Fix parsing of
mongo host/db
connect string. - SERVER-32875: Don’t stall ftdc due to running out of tickets.
- SERVER-33089: Unable to start queryable mongod because itfailed to regenerate index for
admin.system.users
. - 3.4.12 Changelog
- All JIRA issues closed in 3.4.12%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.12%27)
3.4.11 - Jan 31, 2018
Issues fixed:
- SERVER-19605: Oplog timeout should be configurable.
- SERVER-19919: Chunks that exceed 250000 docs but are under half chunk size get marked as jumbo.
- SERVER-29293: Recipient shard fails to abort migration on stepdown.
- SERVER-32001: unindexing a key in a partial unique index may cause server crash
- 3.4.11 Changelog
- All JIRA issues closed in 3.4.11%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.11%27)
3.4.10 - Oct 31, 2017
Issues fixed:
- SERVER-15723: Avoid G_X lock for rename_collection withindatabase
- SERVER-31049: View with collation doesn’t work as expectedin sharded cluster
- SERVER-29287: Upgrade pcre to 8.41
- SERVER-31204: Calling shardCollection afterenableSharding may fail if executed against different mongos
- 3.4.10 Changelog
- All JIRA issues closed in 3.4.10%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.10%27)
3.4.9 - Sept 11, 2017
Issues fixed:
- SERVER-20392: Sharding an existing small collection results in large number of chunks
- SERVER-30189: Reduce calls to allocator for large $in expressions
- SERVER-30487: RangeDeleter holds WT transaction open while waiting for majority
- SERVER-30636: Range deleter assert failed because of replication lag
- 3.4.9 Changelog
- All JIRA issues closed in 3.4.9%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.9%27)
3.4.7 – Aug 8, 2017
Issues fixed:
- SERVER-29282: BSON Document Size can be exceeded when grouping inserts on SECONDARY nodes
- SERVER-29568: Enable configuration of OpenSSL cipher suite via
setParameter
- SERVER-29817: Optimize incremental update performance of ChunkManager and CollectionMetadata
- 3.4.7 Changelog
- All JIRA issues closed in 3.4.7%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.7%27)
3.4.6 – Jul 5, 2017
Issues fixed:
- SERVER-27347: Only close idle cached cursors on theWiredTiger ident that is busy.
- SERVER-29618:
$geoWithin
in aggregation pipeline after$lookup
and$unwind
returns incorrect results. - WT-3362: Cursor opens should never block for the duration of a checkpoint.
- 3.4.6 Changelog
- All JIRA issues closed in 3.4.6%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.6%27)
3.4.5 – Jun 14, 2017
Issues fixed:
- SERVER-28952: Multikey indexes should not be eligible forDISTINCT_SCAN if distinct key is an array component.
- SERVER-28427: GlobalLock with timeout can still block indefinitely.
- SERVER-29018
mongos
can segfault ingetMore
on views with find batchSize of 0. - 3.4.5 Changelog
- All JIRA issues closed in 3.4.5%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.5%27)
3.4.4 – Apr 21, 2017
Issues fixed:
- SERVER-18794: Add an aggregation operator
$objectToArray
to convert an object to an array of key,value pairs. - SERVER-23310: Add an aggregation operator
$arrayToObject
to convert an array of pairs to anobject. - SERVER-22611: ChunkManager refresh can occasionally cause afull reload.
- 3.4.4 Changelog
- All JIRA issues closed in 3.4.4%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.4%27)
3.4.3 – Mar 28, 2017
Issues fixed:
- SERVER-27863: Reschedule firing of early alarms inNetworkInterfaceASIO to avoid
mongos
crash. - SERVER-28017:
$ne
should respect collection’sdefault collation. - SERVER-27700: Improve WiredTiger performance on secondarywhen cache is full.
- 3.4.3 Changelog
- All JIRA issues closed in 3.4.3%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.3%27)
3.4.2 – Feb 1, 2017
Issues fixed:
- SERVER-27125: Arbiters in pv1 should vote no in elections ifthey can see a healthy primary of equal or greater priority to thecandidate.
- SERVER-27584 Add support for filter to listDatabases
- WT-2670 Inefficient I/O when read full DB (poor readahead)
- 3.4.2 Changelog
- All JIRA issues closed in 3.4.2%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.2%27)
3.4.1 – Dec 20, 2016
Issues fixed:
- SERVER-27124: Disallow
readConcern: majority
reads onreplica set protocolVersion 0 (pv0). - SERVER-27201: $graphLookup triggers null pointer dereference.
- SERVER-27207: Find operation with a sort on a view via
mongos
may incorrectly return empty result set. - SERVER-27213: Two
$match
pipeline stages can combineincorrectly to produce incorrect results. - 3.4.1 Changelog
- All JIRA issues closed in 3.4.1%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%273.4.1%27)
Sharded Cluster
Membership Awareness
Starting in 3.4, sharded cluster components (shards, config servers,mongos
instances) recognize their membership in a shardedcluster, including the name of the sharded cluster, the location of theconfig servers.
To support this awareness:
shardsvr
Requirement- For a 3.4 sharded cluster,
mongod
instances for theshards must explicitly specify its role as ashardsvr
,either via the configuration file settingsharding.clusterRole
or via the command line option—shardsvr
.
Note
Default port for mongod
instances with the shardsvr
role is 27018
. To use a different port, specifynet.port
setting or —port
option.
Balancer on Config Server Primary
The balancer process has moved from the mongos
to theprimary member of the config server replica set. Associated with thischange:
- 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:
balancerStart
command and updates the 3.4mongo
shell methodsh.startBalancer()
to wrapthe new command. A 3.2 or earliermongo
shell methodsh.startBalancer()
is incompatible with a 3.4 shardedcluster.balancerStop
command and updates the 3.4mongo
shell methodsh.stopBalancer()
to wrapthe new command. A 3.2 or earliermongo
shell methodsh.stopBalancer()
is incompatible with a 3.4 shardedcluster.balancerStatus
command.
- MongoDB 3.4 deprecates
mongo
shell methodsh.getBalancerHost()
. A 3.2 or earliermongo
shell methodsh.getBalancerHost()
is incompatible with a3.4 sharded cluster. - MongoDB 3.4 removes the following configuration options from the
mongos
:sharding.chunkSize
configuration file setting and—chunkSize
command-line optionsharding.autoSplit
configuration file setting and—noAutoSplit
command-line option
Faster Balancing
Starting in MongoDB 3.4:
- For WiredTiger, the default value
secondaryThrottle
isfalse
for all chunk migrations. Thebalancer does not wait for replication to a secondary and insteadcontinues with the next document. - MongoDB can perform parallel chunk migrations. Similar to earlierversions, 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 chunkmigrations.
Removal of Support for SCCC Config Servers
3.4 sharded clusters no longer support the use of mirrored (SCCC)mongod
instances as config servers. The use of SCCC configservers, 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 mustbe running as a replica set.
To convert your existing config servers from SCCC to CSRS, see theUpgrade Config Servers to Replica Set.
Sharding Zones
MongoDB 3.4 introduces Zones, which supersedestag-aware sharding available in earlier versions.
To support zones, MongoDB introduces the following commands andmongo
shell helpers:
Commands | mongo Shell Methods |
---|---|
addShardToZone | sh.addShardToZone() |
removeShardFromZone | sh.removeShardFromZone() |
updateZoneKeyRange | sh.updateZoneKeyRange() sh.removeRangeFromZone() |
Replica Set
Default Journaling Behavior of majority Write Concern
A new replica set configuration settingwriteConcernMajorityJournalDefault
determines whether anacknowledgement for a write concern of majority
returns after the majority of the voting members applythe write in memory or to the on-disk journal if the joption is unspecified in the write concern.
Adjustable Catchup Period for Newly Elected Primary
A new replica set configuration settingsettings.catchUpTimeoutMillis
defines the time limit for anewly elected primary to catch up with the other replica set membersthat may have more recent writes.
Linearizable Read Concern
MongoDB 3.4 introduces a read concern level of"linearizable"
to read data that reflects all successfulwrites issued with a "majority"
and acknowledgedprior to the start of the read operation. Linearizable read concernguarantees only apply if read operations specify a query filter thatuniquely identifies a single document.
Linearizable read concern is available for all MongoDB supportedstorage engines.
Combined with "majority"
write concern,"linearizable"
read concern enables multiple threads toperform reads and writes on a single document as if a single threadperformed these operations in real time; that is, the correspondingschedule for these reads and writes is considered linearizable.
Reads with linearizable read concern may be significantly slower thanreads with "majority"
or "local"
readconcerns. Always use maxTimeMS
with linearizable read concern, incase a majority of data bearing members are unavailable. For example:
- 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 supportread concerns, see Read Concern.
Improved Initial Sync
MongoDB 3.4 improves the performance of initial sync by having initial sync build the indexesas the documents are copied.
MongoDB 3.4 improves the initial sync retry logic to be more resilient to intermittent failures onthe network.
To avoid potential data corruption, MongoDB 3.4 fails and restartsinitial sync if a collection isrenamed on the sync source during the initial sync. With MongoDB 3.2.11or earlier, initial syncs did not fail and restart but insteadcontinued the process, which could lead to potential data corruption.
For details, see Initial Sync and renameCollection.
- Modified
replSetGetStatus
command to accept the optionalinitialSync: 1
in the command to report on initial sync statusand progress if run on the secondary:
- db.adminCommand( { replSetGetStatus: 1, initialSync: 1 } )
Decimal Type
3.4 adds support for the decimal128 format withthe new decimal
data type. The decimal128 format supports numbers withup to 34 decimal digits (i.e. significant digits) and an exponent rangeof −6143 to +6144.
To support the format, the mongo
shell adds theNumberDecimal wrapper.
- db.inventory.insert( {_id: 1, item: "The Scream", price: NumberDecimal("9.99"), quantity: 4 } )
When performing comparisons amongdifferent numerical types, MongoDB performs comparison on the exactstored numerical values without first converting values to a commontype.
Unlike the double
data type, which only stores an approximation ofthe decimal values, the decimal
data type stores the exact value.For example, a decimal
NumberDecimal("9.99")
has a precisevalue of 9.99
where as a double 9.99
would have an approximatevalue of 9.9900000000000002131628…
.
To test for decimal
type, use the $type
operator with theliteral "decimal"
or 19
.
- db.inventory.find( { price: { $type: "decimal" } } )
To use the new decimal
data type with a MongoDB driver, an upgradeto a driver version that supports the feature is necessary.
Aggregation
New Aggregation Stage for Recursive Search
3.4 introduces a stage to the aggregation pipeline that allows for recursive search.
Stage | Description |
---|---|
$graphLookup | Performs a recursive search on a collection. To each outputdocument, adds a new array field that contains the traversalresults of the recursive search for that document. |
See also
Webinar: Working with Graph Data in MongoDB
New Aggregation Stages for Faceted Search
Faceted search allows for the categorization of documents intoclassifications. For example, given a collection of inventorydocuments, you may want to classify items by a single category, such asby the price range, or by multiple categories, such as by price rangeas well as separately by the departments.
3.4 introduces stages to the aggregation pipeline that allow for faceted search.
Stage | Description |
---|---|
$bucket | Categorizes or groups incoming documents into buckets thatrepresent a range of values for a specified expression. |
$bucketAuto | Categorizes or groups incoming documents into specified numberof buckets that represent a range of values for a specifiedexpression. MongoDB automatically determines the bucketboundaries. |
$facet | Processes multiple pipelines onthe input documents and outputs a document that contains theresults of these pipelines. By specifying facet-related stages($bucket , $bucketAuto , and$sortByCount ) in these pipelines, $facet allows for multi-faceted search. |
$sortByCount | Categorizes or groups incoming documents by a specifiedexpression to compute the count for each group. Output documentsare sorted in descending order by the count. |
New Aggregation Stages to Facilitate Reshaping Documents
3.4 introduces stages to the aggregation pipeline that faciliate replacing documents aswell as adding new fields.
Stage | Description |
---|---|
$addFields | Adds new fields to documents. The stage outputs documents thatcontains all existing fields from the input documents as well asthe newly added fields. |
$replaceRoot | Replaces a document with the specified document. You can specifya document embedded in the input document to promote theembedded document to the top level. |
New Aggregation Stage to Count
3.4 introduces a new stage to the aggregation pipeline that faciliate counting document.
Stage | Description |
---|---|
$count | Returns a document that contains a count of the number ofdocuments input to the stage. |
New Aggregation Array Operators
Operator | Description |
---|---|
$in | Returns a boolean that indicates if a specified value is in anarray. |
$indexOfArray | Searches an array for an occurence of a specified value andreturns the array index (zero-based) of the first occurence. |
$range | Returns an array whose elements are a generated sequence ofnumbers. |
$reverseArray | Returns an output array whose elements are those of the inputarray but in reverse order. |
$reduce | Takes an array as input and applies an expression to eachelement in the array to return the final result of theexpression. |
$zip | Returns an output array where each element is itself an array,consisting of elements in the corresponding array index positionfrom the input arrays. |
New Aggregation String Operators
Operator | Description |
---|---|
$indexOfBytes | Searches a string for an occurence of a substring and returnsthe UTF-8 byte index (zero-based) of the first occurence. |
$indexOfCP | Searches a string for an occurence of a substring and returnsthe UTF-8 code point index(zero-based) of the first occurence. |
$split | Splits a string by a specified delimiter into string componentsand returns an array of the string components. |
$strLenBytes | Returns the number of UTF-8 bytes for a string. |
$strLenCP | Returns the number of UTF-8 code points for a string. |
$substrBytes | Returns the substring of a string. The substring starts with thecharacter at the specified UTF-8 byte index (zero-based) in thestring for the length specified. |
$substrCP | Returns the substring of a string. The substring starts with thecharacter at the specified UTF-8 code point index(zero-based) in the string for the length specified. |
New Aggregation Control Flow Expression
Operator | Description |
---|---|
$switch | Evaluates, in sequential order, the case expressions of thespecified branches to enter the first branch for which thecase expression evaluates to true . |
New Date Aggregation Operators
Operator | Description |
---|---|
$isoDayOfWeek | Returns the ISO 8601 weekday number, ranging from 1 (forMonday) to 7 (for Sunday). |
$isoWeek | Returns the ISO 8601 week number, which can range from 1 to53 . Week numbers start at 1 with the week (Mondaythrough Sunday) that contains the year’s first Thursday. |
$isoWeekYear | Returns the ISO 8601 year number, where the year starts with theMonday of week 1 (ISO 8601) and ends with the Sundays of thelast week (ISO 8601). |
New Monitoring Aggregation Sources
Operator | Description |
---|---|
$collStats | Returns statistics regarding a collection or view. |
New Type Operator
Operator | Description |
---|---|
$type | Returns a string which specifies theBSON Types of the argument. |
Additional Changes
$project
stage adds support for field exclusion in theoutput document. Previously, you could only exclude the _id
fieldin 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.
Collation and Case-Insensitive Indexes
To allow for language-specific rules for string comparison, MongoDB3.4 introduces collation to its query language andindexes.
The following operations support collation:
For details, see Collation.
[1] | (1, 2) Some index types do not support collation. SeeCollation and Unsupported Index Types for details. |
Views
MongoDB 3.4 adds support for creating read-only views from existingcollections or other views. To specify or define a view, MongoDB 3.4introduces:
- the
viewOn
andpipeline
options to the existingcreate
command:
- db.runCommand( { create: <view>, viewOn: <source>, pipeline: <pipeline> } )
or if specifying a default collation for the view:
- db.runCommand( { create: <view>, viewOn: <source>, pipeline: <pipeline>, collation: <collation> } )
- and a corresponding
mongo
shell helperdb.createView()
:
- db.createView(<view>, <source>, <pipeline>, <collation>)
For more information on creating views, see Views.
Security Enhancement
Transition to Auth
MongoDB 3.4 adds support for rolling transition to internalauthentication for replica sets and sharded clusters. For details, seesecurity.transitionToAuth
setting and —transitionToAuth
command line option for mongod
and mongos
.
See also
Update Replica Set to Keyfile Authentication (No Downtime)
User Roles Changes
The privileges of the following built-in roles no longer apply to thelocal
and config
databases:
readAnyDatabase | Starting in 3.4, to provide read privileges on the local database, create a user in the admin database withread role in the local database. See alsoclusterManager and clusterMonitor rolefor access to the config and local databases. |
readWriteAnyDatabase | Starting in 3.4, to provide readWrite privileges on thelocal database, create a user in the admin database withreadWrite role in the local database. See alsoclusterManager and clusterMonitor rolefor access to the config and local databases. |
userAdminAnyDatabase | |
dbAdminAnyDatabase | Starting in 3.4, to provide dbAdmin privileges on thelocal database, create a user in the admin database withdbAdmin role in the local database. See alsoclusterManager and clusterMonitor rolefor access to the config and local databases. |
Correspondingly, the following built-in roles include additional readand write privileges on local
and config
databases:
MongoDB Tools
mongoreplay
MongoDB introduces mongoreplay
, a workload capture andanalysis tool that replaces mongosniff
. You can usemongoreplay
to inspect and record commands sent to a MongoDBinstance, and then replay the commands back onto another host at alater time.
mongoreplay
is available for Linux and macOS.
General Enhancements
MongoDB 3.4 includes the following enhancements:
- Added
systemd
support in distributions. - Increased
diagnosticDataCollectionDirectorySizeMB
default size to 200 megabytes from 100 megabytes. - Decreased the lower bound and the default setting of the
WiredTiger internal cache
. BoththeWiredTiger Storage Engine internal cache
and theinMemory Storage Enginemaximum memory size
can accept floating-point values. find()
,aggregate()
,listIndexes
, andlistCollections
operations return a maximum of 16megabytes per batch.
db.currentOp
and thedatabase profiler report the samebasic diagnostic information for all CRUD operations, including thefollowing:
aggregate
count
delete
distinct
find
(OP_QUERY andcommand
)findAndModify
getMore
(OP_GET_MORE andcommand
)insert
mapReduce
update
These operations are also included in the logging ofslow queries (seeslowOpThresholdMs
formore information about slow query logging).
mongo
shell adds support for marshalling fields of typejavascript andjavascriptWithScope to JavaScript functions.See—disableJavaScriptProtection
.Added support for system certificates. If a
mongod
instance presents a certificate signed with a CA trusted by theoperating system, themongo
shell will connect without anyerrors. Previously, themongo
shell exited with an errorthat it could not validate the certificate.Added message compression support for internal communication betweenmembers of a replica set or a sharded cluster as well ascommunication between
mongo
shell andmongod
ormongos
.
See configuration net.compression.compressors
setting aswell as the —networkMessageCompressors
option formongod
, mongos
, and the mongo
shell.
- Upgraded the SpiderMonkey JavaScript engine to 45.0.2 ESR.
Platform Support
- MongoDB 3.4 introduces support for ARM64, PPC64LE, and s390xarchitectures. See Supported Platforms to see thefull platform support matrix.
- Starting in version 3.4, MongoDB removes support for Red Hat Enterprise Linux 5.
For earlier MongoDB Enterprise versions that support Ubuntu 16.04POWER/PPC64LE:
Due to a lock elision bug present in older versionsof the glibc
package on Ubuntu 16.04 for POWER, you mustupgrade the glibc
package to at least glibc 2.23-0ubuntu5
before running MongoDB. Systems with older versions of theglibc
package will experience database server crashes andmisbehavior due to random memory corruption, and are unsuitablefor production deployments of MongoDB
The following summarizes the supported architecture for the latestversion of MongoDB products:
Product | x86_64/amd64 | s390x | POWER8 (little endian) | ARMv8-A |
---|---|---|---|---|
MongoDB 3.4 | ✓ | MongoDB Enterprise only | MongoDB Enterprise only | ✓ |
BI Connector | ✓ | ✓ | ✓ | |
Compass | ✓ | |||
Spark Connector | ✓ | |||
Ops Manager | ✓ | |||
Automation Agent | ✓ | ✓ | ||
Monitoring Agent | ✓ | ✓ | ||
Backup Agent | ✓ | ✓ |
For details, refer to the individual documentation for the products.
MongoDB Enterprise Features
Log Redaction
MongoDB Enterprise adds support for log redaction for use inconjunction with MongoDB’s encrypted storage engine. Log redaction preventspotentially sensitive information from being written to the diagnosticlog; however, diagnostics on redacted logs may be more difficult due tothe lack of data related to a log event.
To enable log redaction, see thesecurity.redactClientLogData
setting and the—redactClientLogData
option for mongod
.
LDAP Enhancements
LDAP Authorization
MongoDB Enterprise supports the use of Lightweight DirectoryAccess Protocol (LDAP) service to authorize (i.e. determine access) a user authenticated via one of thefollowing authentication mechanism:
- LDAP Proxy Authentication. For a tutorial on using both LDAPAuthentication and Authorization, seeAuthenticate and Authorize Users Using Active Directory via Native LDAP.
- Kerberos Authentication. For a tutorial on using Kerberosauthentication and Active Directory, seeConfigure MongoDB with Kerberos Authentication and Active Directory Authorization.
- x.509.
For more information, see LDAP Authorization.
mongoldap
MongoDB Enterprise provides a new tool mongoldap
for testingyour MongoDB LDAP configuration optionsagainst a running LDAP server or set of servers. When configuringoptions related to LDAP authentication, you canuse mongoldap
to ensure that the authentication operationworks as expected.
Bind via OS Libraries
MongoDB 3.4 supports binding to an LDAP server via operating system libraries. This allowsLinux and Windows MongoDB 3.4 servers to use an LDAP server forauthentication.
Linux MongoDB deployments continue to support binding via saslauthd.
Changes Affecting Compatibility
Some changes can affect compatibility and may require user actions. Fora detailed list of compatibility changes, seeCompatibility Changes in MongoDB 3.4.
- Compatibility Changes in MongoDB 3.4
Upgrade Procedures
If you need guidance on upgrading to 3.4, MongoDB offers major versionupgrade servicesto help ensure a smooth transition without interruption to your MongoDB application.
Download
To download the MongoDB 3.4, go to the MongoDB Download Center
See also
- Upgrade a Standalone to 3.4
- Upgrade a Replica Set to 3.4
- Upgrade a Sharded Cluster to 3.4
- Downgrade MongoDB 3.4 to 3.2
Known Issues in 3.4.0
List of known issues in the 3.4.0 release:
- SERVER-27124:
protocolVersion: 0
cannot properly support"majority"
read concern. - SERVER-27195: Using collation with documents containingfields of BSON type
Symbol
, which is deprecated, is not supportedand may lead to undefined behavior. - SERVER-27207: Find on view with sort through
mongos
may incorrectly return empty result set. - WT-3327: Checkpointscan hang if time runs backwards (e.g.on a system with an unreliable clock).(Fixed in MongoDB 3.4.6.)