-
3.0
Unreleased
Release Notes for MongoDB 3.0¶
March 3, 2015
MongoDB 3.0 is now available. Key features include support for the WiredTiger storage engine, pluggable storage engine API, SCRAM-SHA-1 authentication mechanism, and improved explain functionality.
MongoDB Ops Manager, which includes Automation, Backup, and Monitoring, is now also available. See the Ops Manager documentation and the Ops Manager release notes for more information.
Minor Releases¶
3.0.2 – April 9, 2015¶
- Fix inefficient query plans for 2d :query:`$nearSphere`: :issue:`SERVER-17469`
- Fix problem starting mongod during repair operations with WiredTiger: :issue:`SERVER-17652` and :issue:`SERVER-17729`
- Resolved invalid compression stream error with WiredTiger and zlib block compression: :issue:`SERVER-17713`
- Fix memory use issue for inserts into large indexed arrays: :issue:`SERVER-17616`
- All issues closed in 3.0.2
3.0.1 – March 17, 2015¶
- Fixed race condition in WiredTiger between inserts and checkpoints that could result in lost records: :issue:`SERVER-17506`.
- Resolved issue in WiredTiger’s capped collections implementation that caused a server crash: :issue:`SERVER-17345`.
- Fixed issue is initial sync with duplicate _id entries: :issue:`SERVER-17487`.
- Fixed deadlock condition in MMAPv1 between the journal lock and the oplog collection lock: :issue:`SERVER-17416`.
- All issues closed in 3.0.1
Major Changes¶
Pluggable Storage Engine API¶
MongoDB 3.0 introduces a pluggable storage engine API that allows third parties to develop storage engines for MongoDB.
WiredTiger¶
MongoDB 3.0 introduces support for the WiredTiger storage engine. With the support for WiredTiger, MongoDB now supports two storage engines:
- MMAPv1, the storage engine available in previous versions of MongoDB and the default storage engine for MongoDB 3.0, and
- WiredTiger, available only in the 64-bit versions of MongoDB 3.0.
WiredTiger Usage¶
WiredTiger is an alternate to the default MMAPv1 storage engine. WiredTiger supports all MongoDB features, including operations that report on server, database, and collection statistics. Switching to WiredTiger, however, requires a change to the on-disk storage format. For instructions on changing the storage engine to WiredTiger, see the appropriate sections in the /release-notes/3.0-upgrade documentation.
MongoDB 3.0 replica sets and sharded clusters can have members with different storage engines; however, performance can vary according to workload. For details, see the appropriate sections in the /release-notes/3.0-upgrade documentation.
The WiredTiger storage engine requires the latest official MongoDB drivers. For more information, see 3.0-compatibility-drivers-wired-tiger.
See also
3.0-compatibility-touch, storage-wiredtiger section in the /core/storage documentation
WiredTiger Configuration¶
To configure the behavior and properties of the WiredTiger storage engine, see :setting:`storage.wiredTiger` configuration options. You can set WiredTiger options on the command line.
See also
storage-wiredtiger section in the /core/storage documentation
WiredTiger Concurrency and Compression¶
The 3.0 WiredTiger storage engine provides document-level locking and compression.
By default, WiredTiger compresses collection data using the snappy compression library. WiredTiger uses prefix compression on all indexes by default.
See also
prod-notes-wired-tiger-concurrency section in the /administration/production-notes
MMAPv1 Improvements¶
MMAPv1 Concurrency Improvement¶
In version 3.0, the MMAPv1 storage engine adds support for collection-level locking.
MMAPv1 Configuration Changes¶
To support multiple storage engines, some configuration settings for MMAPv1 have changed. See 3.0-compatibility-configuration-file.
MMAPv1 Record Allocation Behavior Changes¶
MongoDB 3.0 no longer implements dynamic record allocation and deprecates paddingFactor. The default allocation strategy for collections in instances that use MMAPv1 is power of 2 allocation, which has been improved to better handle large document sizes. In 3.0, the usePowerOf2Sizes flag is ignored, so the power of 2 strategy is used for all collections that do not have noPadding flag set.
For collections with workloads that consist only of inserts or in-place updates (such as incrementing counters), you can disable the power of 2 strategy. To disable the power of 2 strategy for a collection, use the :dbcommand:`collMod` command with the :collflag:`noPadding` flag or the :method:`db.createCollection()` method with the noPadding option.
Warning
Do not set noPadding if the workload includes removes or any updates that may cause documents to grow. For more information, see exact-fit-allocation.
When low on disk space, MongoDB 3.0 no longer errors on all writes but only when the required disk allocation fails. As such, MongoDB now allows in-place updates and removes when low on disk space.
See also
3.0-compatiblity-record-alloc
Replica Sets¶
Increased Number of Replica Set Members¶
In MongoDB 3.0, replica sets can have up to 50 members. [1] The following drivers support the larger replica sets:
- C# (.NET) Driver 1.10
- Java Driver 2.13
- Python Driver (PyMongo) 3.0+
- Ruby Driver 2.0+
- Node.JS Driver 2.0+
Because the C, C++, Perl, PHP, and earlier versions of the Ruby, Python, and Node.JS drivers discover and monitor replica set members serially, these drivers are not suitable for use with large replica sets.
PyMongo 3.0 is currently in development.
[1] The maximum number of voting members remains at 7. Replica Set Step Down Behavior Changes¶
The process that a primary member of a replica set uses to step down has the following changes:
- Before stepping down, :dbcommand:`replSetStepDown` will attempt to terminate long running user operations that would block the primary from stepping down, such as an index build, a write operation or a map-reduce job.
- To help prevent rollbacks, the :dbcommand:`replSetStepDown` will wait for an electable secondary to catch up to the state of the primary before stepping down. Previously, a primary would wait for a secondary to catch up to within 10 seconds of the primary (i.e. a secondary with a replication lag of 10 seconds or less) before stepping down.
- :dbcommand:`replSetStepDown` now allows users to specify a secondaryCatchUpPeriodSecs parameter to specify how long the primary should wait for a secondary to catch up before stepping down.
Other Replica Set Operational Changes¶
- Initial sync builds indexes more efficiently for each collection and applies oplog entries in batches using threads.
- Definition of w: “majority” write concern changed to mean majority of voting nodes.
- Stronger restrictions on /reference/replica-configuration. For details, see 3.0-compatibility-repl-set-config.
- For pre-existing collections on secondary members, MongoDB 3.0 no longer automatically builds missing _id indexes.
See also
3.0-compatibility-rs in /release-notes/3.0-compatibility
Sharded Clusters¶
MongoDB 3.0 provides the following enhancements to sharded clusters:
- Adds a new :method:`sh.removeTagRange()` helper to improve management of sharded collections with tags. The new :method:`sh.removeTagRange()` method acts as a complement to :method:`sh.addTagRange()`.
- Provides a more predictable read preference behavior. mongos instances no longer pin connections to members of replica sets when performing read operations. Instead, mongos reevaluates read preferences for every operation to provide a more predictable read preference behavior when read preferences change.
- Provides a new writeConcern setting to configure the write concern of chunk migration operations. You can configure the writeConcern setting for the balancer as well as for :dbcommand:`moveChunk` and :dbcommand:`cleanupOrphaned` commands.
- Improves visibility of balancer operations. :method:`sh.status()` includes information about the state of the balancer. See :method:`sh.status()` for details.
See also
3.0-compatibility-sharded-cluster in /release-notes/3.0-compatibility
Security Improvements¶
MongoDB 3.0 includes the following security enhancements:
- MongoDB 3.0 adds a new SCRAM-SHA-1 challenge-response user authentication mechanism. SCRAM-SHA-1 requires a driver upgrade if your current driver version does not support SCRAM-SHA-1. For the driver versions that support SCRAM-SHA-1, see considerations-scram-sha-1-drivers.
- Increases restrictions when using the localhost-exception to access MongoDB. For details, see 3.0-compatibility-localhost.
See also
3.0-compatibility-security-changes
Improvements¶
New Query Introspection System¶
MongoDB 3.0 includes a new query introspection system that provides an improved output format and a finer-grained introspection into both query plan and query execution.
For details, see the new :method:`db.collection.explain()` method and the new :dbcommand:`explain` command as well as the updated :method:`cursor.explain()` method.
For information on the format of the new output, see /reference/explain-results.
Enhanced Logging¶
To improve usability of the log messages for diagnosis, MongoDB categorizes some log messages under specific components, or operations, and provides the ability to set the verbosity level for these components. For information, see /reference/log-messages.
MongoDB Tools Enhancements¶
All MongoDB tools are now written in Go and maintained as a separate project.
- New options for parallelized mongodump and mongorestore. You can control the number of collections that mongorestore will restore at a time with the --numParallelCollections option.
- New options -excludeCollection and --excludeCollectionsWithPrefix for mongodump to exclude collections.
- mongorestore can now accept BSON data input from standard input in addition to reading BSON data from file.
- mongostat and mongotop can now return output in JSON format with the --json option.
- Added configurable write concern to mongoimport, mongorestore, and mongofiles. Use the --writeConcern option.
- mongofiles now allows you to configure the GridFS prefix with the --prefix option so that you can use custom namespaces and store multiple GridFS namespaces in a single database.
See also
3.0-compatibility-tools
Indexes¶
- Background index builds will no longer automatically interrupt if :dbcommand:`dropDatabase`, :dbcommand:`drop`, :dbcommand:`dropIndexes` operations occur for the database or collection affected by the index builds. The :dbcommand:`dropDatabase`, :dbcommand:`drop`, and :dbcommand:`dropIndexes` commands will still fail with the error message a background operation is currently running, as in 2.6.
- If you specify multiple indexes to the :dbcommand:`createIndexes`
command,
- the command only scans the collection once, and
- if at least one index is to be built in the foreground, the operation will build all the specified indexes in the foreground.
- For sharded collections, indexes can now cover queries that execute against the mongos if the index includes the shard key.
See also
3.0-compatibility-indexes in /release-notes/3.0-compatibility
Query Enhancements¶
MongoDB 3.0 includes the following query enhancements:
- For geospatial queries, adds support for “big” polygons for :query:`$geoIntersects` and :query:`$geoWithin` queries. “Big” polygons are single-ringed GeoJSON polygons with areas greater than that of a single hemisphere. See :query:`$geometry`, :query:`$geoIntersects`, and :query:`$geoWithin` for details.
- For :method:`~db.collection.aggregate()`, adds a new :expression:`$dateToString` operator to facilitate converting a date to a formatted string.
- Adds the :query:`$eq` query operator to query for equality conditions.
See also
3.0-geo-near-compatibility
Distributions¶
Most non-Enterprise MongoDB distributions now include support for SSL. Previously, only MongoDB Enterprise distributions came with SSL support included; for non-Enterprise distributions, you had to build MongoDB locally with the --ssl flag (i.e. scons --ssl).
MongoDB Enterprise Features¶
Auditing¶
/core/auditing in MongoDB Enterprise can filter on any field in the audit message, including the fields returned in the param document. This enhancement, along with the :parameter:`auditAuthorizationSuccess` parameter, enables auditing to filter on CRUD operations. However, enabling :parameter:`auditAuthorizationSuccess` to audit of all authorization successes degrades performance more than auditing only the authorization failures.
Additional Information¶
Changes Affecting Compatibility¶
Some changes in 3.0 can affect compatibility and may require user actions. For a detailed list of compatibility changes, see /release-notes/3.0-compatibility.
Download¶
To download MongoDB 3.0, go to the downloads page.
Additional Resources¶
-
3.0.2
Released at April 9, 2015
- Fix inefficient query plans for 2d :query:`$nearSphere`: :issue:`SERVER-17469`
- Fix problem starting mongod during repair operations with WiredTiger: :issue:`SERVER-17652` and :issue:`SERVER-17729`
- Resolved invalid compression stream error with WiredTiger and zlib block compression: :issue:`SERVER-17713`
- Fix memory use issue for inserts into large indexed arrays: :issue:`SERVER-17616`
- All issues closed in 3.0.2
-
3.0.1
Released at March 17, 2015
- Fixed race condition in WiredTiger between inserts and checkpoints that could result in lost records: :issue:`SERVER-17506`.
- Resolved issue in WiredTiger’s capped collections implementation that caused a server crash: :issue:`SERVER-17345`.
- Fixed issue is initial sync with duplicate _id entries: :issue:`SERVER-17487`.
- Fixed deadlock condition in MMAPv1 between the journal lock and the oplog collection lock: :issue:`SERVER-17416`.
- All issues closed in 3.0.1
-
2.6.9
Released at March 24, 2015
- Resolve connection handling related crash with mongos instances :issue:`SERVER-17441`
- Add server parameter to configure idle cursor timeout :issue:`SERVER-8188`
- Remove duplicated (orphan) documents from aggregation pipelines with _id queries in sharded clusters :issue:`SERVER-17426`
- Fixed crash in :dbcommand:`geoNear` queries with multiple 2dsphere indexes :issue:`SERVER-14723`
- All issues closed in 2.6.9
-
2.6.8
Released at Feb. 25, 2015
- Add :dbcommand:`listCollections` command functionality to 2.6 shell and client :issue:`SERVER-17087`
- :dbcommand:`copydb`/:dbcommand:`clone` commands can crash the server if a primary steps down :issue:`SERVER-16599`
- Secondary fasserts trying to replicate an index :issue:`SERVER-16274`
- Query optimizer should always use equality predicate over unique index when possible :issue:`SERVER-15802`
- All issues closed in 2.6.8
-
2.6.7
Released at Jan. 13, 2015
- Decreased mongos memory footprint when shards have several tags :issue:`SERVER-16683`
- Removed check for shard version if the primary server is down :issue:`SERVER-16237`
- Fixed: /etc/init.d/mongod startup script failure with dirname message :issue:`SERVER-16081`
- Fixed: mongos can cause shards to hit the in-memory sort limit by requesting more results than needed :issue:`SERVER-14306`
- All issues closed in 2.6.7
-
2.6.6
Released at Dec. 9, 2014
- Fixed: Evaluating candidate query plans with concurrent writes on same collection may crash mongod :issue:`SERVER-15580`
- Fixed: 2.6 mongod crashes with segfault when added to a 2.8 replica set with 12 or more members :issue:`SERVER-16107`
- Fixed: :query:`$regex`, :query:`$in` and :query:`$sort` with index returns too many results :issue:`SERVER-15696`
- Change: :dbcommand:`moveChunk` will fail if there is data on the target shard and a required index does not exist. :issue:`SERVER-12472`
- Primary should abort if encountered problems writing to the oplog :issue:`SERVER-12058`
- All issues closed in 2.6.6
-
2.6.5
Released at Oct. 7, 2014
- :query:`$rename` now uses correct dotted source paths :issue:`SERVER-15029`
- Partially written journal last section does not affect recovery :issue:`SERVER-15111`
- Explicitly zero .ns files on creation :issue:`SERVER-15369`
- Plan ranker will no longer favor intersection plans if predicate generates empty range index scan :issue:`SERVER-14961`
- Generate Community and Enterprise packages for SUSE 11 :issue:`SERVER-10642`
- All issues closed in 2.6.5
-
2.6.4
Released at Aug. 11, 2014
- Fix for text index where under specific circumstances, in-place updates to a text-indexed field may result in incorrect/incomplete results :issue:`SERVER-14738`
- Check the size of the split point before performing a manual split chunk operation :issue:`SERVER-14431`
- Ensure read preferences are re-evaluated by drawing secondary connections from a global pool and releasing back to the pool at the end of a query/command :issue:`SERVER-9788`
- Allow read from secondaries when both audit and authorization are enabled in a sharded cluster :issue:`SERVER-14170`
- All issues closed in 2.6.4
-
2.6.3
Released at June 19, 2014
- Equality queries on _id with projection may return no results on sharded collections :issue:`SERVER-14302`.
- Equality queries on _id with projection on _id may return orphan documents on sharded collections :issue:`SERVER-14304`.
- All issues closed in 2.6.3.
-
2.6.2
Released at June 16, 2014
- Query plans with differing performance can tie during plan ranking :issue:`SERVER-13675`.
- mongod may terminate if x.509 authentication certificate is invalid :issue:`SERVER-13753`.
- Temporary map/reduce collections are incorrectly replicated to secondaries :issue:`SERVER-13981`.
- mongos incorrectly targets multiple shards for nested field shard key predicates :issue:`SERVER-14138`.
- :method:`rs.stepDown()` during mapReduce causes fassert when writing to op log :issue:`SERVER-14186`.
-
2.6.1
Released at May 5, 2014
- Fix to install MongoDB service on Windows with the --install option :issue:`SERVER-13515`.
- Allow direct upgrade from 2.4.x to 2.6.0 via yum :issue:`SERVER-13563`.
- Fix issues with background index builds on secondaries: :issue:`SERVER-13589` and :issue:`SERVER-13620`.
- Redact credential information passed as startup options :issue:`SERVER-13644`.
- 2.6.1 Changelog.
- All issues closed in 2.6.1.
-
2.6
Discovered at May 5, 2014
Release Notes for MongoDB 2.6¶
April 8, 2014
MongoDB 2.6 is now available. Key features include aggregation enhancements, text-search integration, query-engine improvements, a new write-operation protocol, and security enhancements.
MMS 1.4, which includes On-Prem Backup in addition to Monitoring, is now also available. See :mms-hosted:`MMS 1.4 documentation </v1.4/>` and the :mms-hosted:`MMS 1.4 release notes </v1.4/management/changelog/>` for more information.
Minor Releases¶
2.6.9 – March 24, 2015¶
- Resolve connection handling related crash with mongos instances :issue:`SERVER-17441`
- Add server parameter to configure idle cursor timeout :issue:`SERVER-8188`
- Remove duplicated (orphan) documents from aggregation pipelines with _id queries in sharded clusters :issue:`SERVER-17426`
- Fixed crash in :dbcommand:`geoNear` queries with multiple 2dsphere indexes :issue:`SERVER-14723`
- All issues closed in 2.6.9
2.6.8 – February 25, 2015¶
- Add :dbcommand:`listCollections` command functionality to 2.6 shell and client :issue:`SERVER-17087`
- :dbcommand:`copydb`/:dbcommand:`clone` commands can crash the server if a primary steps down :issue:`SERVER-16599`
- Secondary fasserts trying to replicate an index :issue:`SERVER-16274`
- Query optimizer should always use equality predicate over unique index when possible :issue:`SERVER-15802`
- All issues closed in 2.6.8
2.6.7 – January 13, 2015¶
- Decreased mongos memory footprint when shards have several tags :issue:`SERVER-16683`
- Removed check for shard version if the primary server is down :issue:`SERVER-16237`
- Fixed: /etc/init.d/mongod startup script failure with dirname message :issue:`SERVER-16081`
- Fixed: mongos can cause shards to hit the in-memory sort limit by requesting more results than needed :issue:`SERVER-14306`
- All issues closed in 2.6.7
2.6.6 – December 09, 2014¶
- Fixed: Evaluating candidate query plans with concurrent writes on same collection may crash mongod :issue:`SERVER-15580`
- Fixed: 2.6 mongod crashes with segfault when added to a 2.8 replica set with 12 or more members :issue:`SERVER-16107`
- Fixed: :query:`$regex`, :query:`$in` and :query:`$sort` with index returns too many results :issue:`SERVER-15696`
- Change: :dbcommand:`moveChunk` will fail if there is data on the target shard and a required index does not exist. :issue:`SERVER-12472`
- Primary should abort if encountered problems writing to the oplog :issue:`SERVER-12058`
- All issues closed in 2.6.6
2.6.5 – October 07, 2014¶
- :query:`$rename` now uses correct dotted source paths :issue:`SERVER-15029`
- Partially written journal last section does not affect recovery :issue:`SERVER-15111`
- Explicitly zero .ns files on creation :issue:`SERVER-15369`
- Plan ranker will no longer favor intersection plans if predicate generates empty range index scan :issue:`SERVER-14961`
- Generate Community and Enterprise packages for SUSE 11 :issue:`SERVER-10642`
- All issues closed in 2.6.5
2.6.4 – August 11, 2014¶
- Fix for text index where under specific circumstances, in-place updates to a text-indexed field may result in incorrect/incomplete results :issue:`SERVER-14738`
- Check the size of the split point before performing a manual split chunk operation :issue:`SERVER-14431`
- Ensure read preferences are re-evaluated by drawing secondary connections from a global pool and releasing back to the pool at the end of a query/command :issue:`SERVER-9788`
- Allow read from secondaries when both audit and authorization are enabled in a sharded cluster :issue:`SERVER-14170`
- All issues closed in 2.6.4
2.6.3 – June 19, 2014¶
- Equality queries on _id with projection may return no results on sharded collections :issue:`SERVER-14302`.
- Equality queries on _id with projection on _id may return orphan documents on sharded collections :issue:`SERVER-14304`.
- All issues closed in 2.6.3.
2.6.2 – June 16, 2014¶
- Query plans with differing performance can tie during plan ranking :issue:`SERVER-13675`.
- mongod may terminate if x.509 authentication certificate is invalid :issue:`SERVER-13753`.
- Temporary map/reduce collections are incorrectly replicated to secondaries :issue:`SERVER-13981`.
- mongos incorrectly targets multiple shards for nested field shard key predicates :issue:`SERVER-14138`.
- :method:`rs.stepDown()` during mapReduce causes fassert when writing to op log :issue:`SERVER-14186`.
2.6.1 – May 5, 2014¶
- Fix to install MongoDB service on Windows with the --install option :issue:`SERVER-13515`.
- Allow direct upgrade from 2.4.x to 2.6.0 via yum :issue:`SERVER-13563`.
- Fix issues with background index builds on secondaries: :issue:`SERVER-13589` and :issue:`SERVER-13620`.
- Redact credential information passed as startup options :issue:`SERVER-13644`.
- 2.6.1 Changelog.
- All issues closed in 2.6.1.
Major Changes¶
The following changes in MongoDB affect both the standard and Enterprise editions:
Aggregation Enhancements¶
The aggregation pipeline adds the ability to return result sets of any size, either by returning a cursor or writing the output to a collection. Additionally, the aggregation pipeline supports variables and adds new operations to handle sets and redact data.
- The :method:`db.collection.aggregate()` now returns a cursor, which enables the aggregation pipeline to return result sets of any size.
- Aggregation pipelines now support an explain operation to aid analysis of aggregation operations.
- Aggregation can now use a more efficient external-disk-based sorting process.
- New pipeline stages:
- :pipeline:`$out` stage to output to a collection.
- :pipeline:`$redact` stage to allow additional control to accessing the data.
- New or modified operators:
- set expression operators.
- :expression:`$let` and :expression:`$map` operators to allow for the use of variables.
- :expression:`$literal` operator and :expression:`$size` operator.
- :expression:`$cond` expression now accepts either an object or an array.
Text Search Integration¶
Text search is now enabled by default, and the query system, including the aggregation pipeline :pipeline:`$match` stage, includes the :query:`$text` operator, which resolves text-search queries.
MongoDB 2.6 includes an updated text index format and deprecates the :dbcommand:`text` command.
Insert and Update Improvements¶
Improvements to the update and insert systems include additional operations and improvements that increase consistency of modified data.
- New or enhanced update operators:
- :update:`$bit` operator supports bitwise xor operation.
- :update:`$min` and :update:`$max` operators that perform conditional update depending on the relative size of the specified value and the current value of a field.
- :update:`$push` operator has enhanced support for the :update:`$sort`, :update:`$slice`, and :update:`$each` modifiers and supports a new :update:`$position` modifier.
- :update:`$currentDate` operator to set the value of a field to the current date.
- The :update:`$mul` operator for multiplicative increments for insert and update operations.
See also
update-operations-incompatibility
New Write Operation Protocol¶
A new write protocol integrates write operations with write concerns. The protocol also provides improved support for bulk operations.
MongoDB 2.6 adds the write commands :dbcommand:`insert`, :dbcommand:`update`, and :dbcommand:`delete`, which provide the basis for the improved bulk insert. All officially supported MongoDB drivers support the new write commands.
The mongo shell now includes methods to perform bulk-write operations. See :method:`Bulk()` for more information.
See also
write-methods-incompatibility
MSI Package for MongoDB Available for Windows¶
MongoDB now distributes MSI packages for Microsoft Windows. This is the recommended method for MongoDB installation under Windows.
Security Improvements¶
MongoDB 2.6 enhances support for secure deployments through improved SSL support, x.509-based authentication, an improved authorization system with more granular controls, as well as centralized credential storage, and improved user management tools.
Specifically these changes include:
- A new authorization model that provides the ability to create custom user-defined-roles and the ability to specify user privileges at a collection-level granularity.
- Global user management, which stores all user and user-defined role data in the admin database and provides a new set of commands for managing users and roles.
- x.509 certificate authentication for client authentication as well as for internal authentication of sharded and/or replica set cluster members. x.509 authentication is only available for deployments using SSL.
- Enhanced SSL Support:
- Rolling upgrades of clusters to use SSL.
- mongodb-tools-support-ssl support connections to mongod and mongos instances using SSL connections.
- Prompt for passphrase by mongod or mongos at startup.
- Require the use of strong SSL ciphers, with a minimum 128-bit key length for all connections. The strong-cipher requirement prevents an old or malicious client from forcing use of a weak cipher.
- MongoDB disables the http interface by default, limiting network exposure. To enable the interface, see :setting:`~net.http.enabled`.
See also
authentication-incompatibility, ssl-hostname-validation, and /administration/security-checklist.
Query Engine Improvements¶
- MongoDB can now use index intersection to fulfill queries supported by more than one index.
- index-filters to limit which indexes can become the winning plan for a query.
- /reference/method/js-plan-cache methods to view and clear the query plans cached by the query optimizer.
- MongoDB can now use :method:`~cursor.count()` with :method:`~cursor.hint()`. See :method:`~cursor.count()` for details.
Improvements¶
Geospatial Enhancements¶
- 2dsphere indexes version 2.
- Support for geojson-multipoint, geojson-multilinestring, geojson-multipolygon, and geojson-geometrycollection.
- Support for geospatial query clauses in :query:`$or` expressions.
See also
2.6-2dsphere-version-incompatibility, 2.6-geo-maxDistance-incompatibility, 2.6-uniqueDocs-incompatibility, 2.6-geospatial-validation-incompatibility
Index Build Enhancements¶
Background index build allowed on secondaries. If you initiate a background index build on a primary, the secondaries will replicate the index build in the background.
Automatic rebuild of interrupted index builds after a restart.
- If a standalone or a primary instance terminates during an index build without a clean shutdown, mongod now restarts the index build when the instance restarts. If the instance shuts down cleanly or if a user kills the index build, the interrupted index builds do not automatically restart upon the restart of the server.
- If a secondary instance terminates during an index build, the mongod instance will now restart the interrupted index build when the instance restarts.
To disable this behavior, use the --noIndexBuildRetry command-line option.
:method:`~db.collection.ensureIndex()` now wraps a new :dbcommand:`createIndex` command.
The dropDups option to :method:`~db.collection.ensureIndex()` and :dbcommand:`createIndex` is deprecated.
See also
2.6-index-key-length-incompatibility
Enhanced Sharding and Replication Administration¶
- New :dbcommand:`cleanupOrphaned` command to remove orphaned documents from a shard.
- New :dbcommand:`mergeChunks` command to combine contiguous chunks located on a single shard. See :dbcommand:`mergeChunks` and /tutorial/merge-chunks-in-sharded-cluster.
- New :method:`rs.printReplicationInfo()` and :method:`rs.printSlaveReplicationInfo()` methods to provide a formatted report of the status of a replica set from the perspective of the primary and the secondary, respectively.
Configuration Options YAML File Format¶
MongoDB 2.6 supports a YAML-based configuration file format in addition to the previous configuration file format. See the documentation of the Configuration File for more information.
Operational Changes¶
Storage¶
:collflag:`usePowerOf2Sizes` is now the default allocation strategy for all new collections. The new allocation strategy uses more storage relative to total document size but results in lower levels of storage fragmentation and more predictable storage capacity planning over time.
To use the previous exact-fit allocation strategy:
- For a specific collection, use :dbcommand:`collMod` with :collflag:`usePowerOf2Sizes` set to false.
- For all new collections on an entire mongod instance, set :parameter:`newCollectionsUsePowerOf2Sizes` to false.
See /core/storage for more information about MongoDB’s storage system.
Networking¶
- Removed upward limit for the :setting:`~net.maxIncomingConnections` for mongod and mongos. Previous versions capped the maximum possible :setting:`~net.maxIncomingConnections` setting at 20,000 connections.
- Connection pools for a mongos instance may be used by multiple MongoDB servers. This can reduce the number of connections needed for high-volume workloads and reduce resource consumption in sharded clusters.
- The C++ driver now monitors replica set health with the :dbcommand:`isMaster` command instead of :dbcommand:`replSetGetStatus`. This allows the C++ driver to support systems that require authentication.
- New :method:`cursor.maxTimeMS()` and corresponding maxTimeMS option for commands to specify a time limit.
Tool Improvements¶
- mongo shell supports a global /etc/mongorc.js.
- All MongoDB executable files now support the --quiet option to suppress all logging output except for error messages.
- mongoimport uses the input filename, without the file extension if any, as the collection name if run without the -c or --collection specification.
- mongoexport can now constrain export data using --skip and --limit, as well as order the documents in an export using the --sort option.
- mongostat can support the use of --rowcount (-n) with the --discover option to produce the specified number of output lines.
- Add strict mode representation for :bsontype:`data_numberlong` for use by mongoexport and mongoimport.
MongoDB Enterprise Features¶
The following changes are specific to MongoDB Enterprise Editions:
MongoDB Enterprise for Windows¶
MongoDB Enterprise for Windows is now available. It includes support for Kerberos, SSL, and SNMP.
MongoDB Enterprise for Windows includes OpenSSL version 1.0.1g.
Auditing¶
MongoDB Enterprise adds auditing capability for mongod and mongos instances. See auditing for details.
LDAP Support for Authentication¶
MongoDB Enterprise provides support for proxy authentication of users. This allows administrators to configure a MongoDB cluster to authenticate users by proxying authentication requests to a specified Lightweight Directory Access Protocol (LDAP) service. See /tutorial/configure-ldap-sasl-openldap and /tutorial/configure-ldap-sasl-activedirectory for details.
MongoDB does not support LDAP authentication in mixed sharded cluster deployments that contain both version 2.4 and version 2.6 shards. See /release-notes/2.6-upgrade for upgrade instructions.
Expanded SNMP Support¶
MongoDB Enterprise has greatly expanded its SNMP support to provide SNMP access to nearly the full range of metrics provided by :method:`db.serverStatus()`.
See also
2.6-snmp-iana-mib-incompatibility
Additional Information¶
Changes Affecting Compatibility¶
Some changes in 2.6 can affect compatibility and may require user actions. The 2.6 mongo shell provides a :method:`db.upgradeCheckAllDBs()` method to perform a check for upgrade preparedness for some of these changes.
See /release-notes/2.6-compatibility for a detailed list of compatibility changes.
Download¶
To download MongoDB 2.6, go to the downloads page.
Other Resources¶
-
2.4.13
Released at Feb. 25, 2015
- Enforce BSON BinData length validation :issue:`SERVER-17278`
- Disable SSLv3 ciphers :issue:`SERVER-15673`
- Improve BSON validation :issue:`SERVER-17264`
- 2.4.13 Changelog.
- All 2.4.13 improvements.
-
2.4.12
Released at Oct. 16, 2014
- Partially written journal last section causes recovery to fail :issue:`SERVER-15111`.
- Explicitly zero .ns files on creation :issue:`SERVER-15369`.
- 2.4.12 Changelog.
- All 2.4.12 improvements.
-
2.4.11
Released at Aug. 18, 2014
- Fixed potential information leak: :issue:`SERVER-14268`.
- Resolved issue were an _id with a $prefix field caused replication failure due to unvalidated insert :issue:`SERVER-12209`.
- Addressed issue where updates to documents with text-indexed fields could lead to incorrect entries :issue:`SERVER-14738`.
- Resolved issue where creating descending index on _id could corrupt namespace :issue:`SERVER-14833`.
- 2.4.11 Changelog.
- All 2.4.11 improvements.
-
2.4.10
Released at April 4, 2014
- Performs fast file allocation on Windows when available :issue:`SERVER-8480`.
- Start elections if more than one primary is detected :issue:`SERVER-10793`.
- Changes to allow safe downgrading from v2.6 to v2.4 :issue:`SERVER-12914`, :issue:`SERVER-12175`.
- Fixes for edge cases in index creation :issue:`SERVER-12481`, :issue:`SERVER-12956`.
- 2.4.10 Changelog.
- All 2.4.10 improvements.
-
2.4.9
Released at Jan. 10, 2014
- Fix for instances where mongos incorrectly reports a successful write :issue:`SERVER-12146`.
- Make non-primary read preferences consistent with slaveOK versioning logic :issue:`SERVER-11971`.
- Allow new sharded cluster connections to read from secondaries when primary is down :issue:`SERVER-7246`.
- All 2.4.9 improvements.
-
2.4.8
Released at Nov. 1, 2013
- Increase future compatibility for 2.6 authorization features :issue:`SERVER-11478`.
- Fix :dbcommand:`dbhash` cache issue for config servers :issue:`SERVER-11421`.
- All 2.4.8 improvements.
-
2.4.7
Released at Oct. 21, 2013
- Fixed over-aggressive caching of V8 Isolates :issue:`SERVER-10596`.
- Removed extraneous initial count during mapReduce :issue:`SERVER-9907`.
- Cache results of dbhash command :issue:`SERVER-11021`.
- Fixed memory leak in aggregation :issue:`SERVER-10554`.
- All 2.4.7 improvements.
-
2.4.6
Released at Aug. 20, 2013
- Fix for possible loss of documents during the chunk migration process if a document in the chunk is very large :issue:`SERVER-10478`.
- Fix for C++ client shutdown issues :issue:`SERVER-8891`.
- Improved replication robustness in presence of high network latency :issue:`SERVER-10085`.
- Improved Solaris support :issue:`SERVER-9832`, :issue:`SERVER-9786`, and :issue:`SERVER-7080`.
- All 2.4.6 improvements.
-
2.4.5
Released at July 3, 2013
- Fix for CVE-2013-4650 Improperly grant user system privileges on databases other than local :issue:`SERVER-9983`.
- Fix for CVE-2013-3969 Remotely triggered segmentation fault in Javascript engine :issue:`SERVER-9878`.
- Fix to prevent identical background indexes from being built :issue:`SERVER-9856`.
- Config server performance improvements :issue:`SERVER-9864` and :issue:`SERVER-5442`.
- Improved initial sync resilience to network failure :issue:`SERVER-9853`.
- All 2.4.5 improvements.
-
2.4.4
Released at June 4, 2013
- Performance fix for Windows version :issue:`SERVER-9721`
- Fix for config upgrade failure :issue:`SERVER-9661`.
- Migration to Cyrus SASL library for MongoDB Enterprise :issue:`SERVER-8813`.
- All 2.4.4 improvements.
-
2.4.3
Released at April 23, 2013
- Fix for mongo shell ignoring modified object’s _id field :issue:`SERVER-9385`.
- Fix for race condition in log rotation :issue:`SERVER-4739`.
- Fix for copydb command with authorization in a sharded cluster :issue:`SERVER-9093`.
- All 2.4.3 improvements.
-
2.4.2
Released at April 17, 2013
- Several V8 memory leak and performance fixes :issue:`SERVER-9267` and :issue:`SERVER-9230`.
- Fix for upgrading sharded clusters :issue:`SERVER-9125`.
- Fix for high volume connection crash :issue:`SERVER-9014`.
- All 2.4.2 improvements
-
2.4.1
Released at April 17, 2013
- Fix for losing index changes during initial sync :issue:`SERVER-9087`
- All 2.4.1 improvements.
-
2.4
Discovered at April 17, 2013
Release Notes for MongoDB 2.4¶
March 19, 2013
MongoDB 2.4 includes enhanced geospatial support, switch to V8 JavaScript engine, security enhancements, and text search (beta) and hashed index.
Minor Releases¶
2.4.13 – February 25, 2015¶
- Enforce BSON BinData length validation :issue:`SERVER-17278`
- Disable SSLv3 ciphers :issue:`SERVER-15673`
- Improve BSON validation :issue:`SERVER-17264`
- 2.4.13 Changelog.
- All 2.4.13 improvements.
2.4.12 – October 16, 2014¶
- Partially written journal last section causes recovery to fail :issue:`SERVER-15111`.
- Explicitly zero .ns files on creation :issue:`SERVER-15369`.
- 2.4.12 Changelog.
- All 2.4.12 improvements.
2.4.11 – August 18, 2014¶
- Fixed potential information leak: :issue:`SERVER-14268`.
- Resolved issue were an _id with a $prefix field caused replication failure due to unvalidated insert :issue:`SERVER-12209`.
- Addressed issue where updates to documents with text-indexed fields could lead to incorrect entries :issue:`SERVER-14738`.
- Resolved issue where creating descending index on _id could corrupt namespace :issue:`SERVER-14833`.
- 2.4.11 Changelog.
- All 2.4.11 improvements.
2.4.10 – April 4, 2014¶
- Performs fast file allocation on Windows when available :issue:`SERVER-8480`.
- Start elections if more than one primary is detected :issue:`SERVER-10793`.
- Changes to allow safe downgrading from v2.6 to v2.4 :issue:`SERVER-12914`, :issue:`SERVER-12175`.
- Fixes for edge cases in index creation :issue:`SERVER-12481`, :issue:`SERVER-12956`.
- 2.4.10 Changelog.
- All 2.4.10 improvements.
2.4.9 – January 10, 2014¶
- Fix for instances where mongos incorrectly reports a successful write :issue:`SERVER-12146`.
- Make non-primary read preferences consistent with slaveOK versioning logic :issue:`SERVER-11971`.
- Allow new sharded cluster connections to read from secondaries when primary is down :issue:`SERVER-7246`.
- All 2.4.9 improvements.
2.4.8 – November 1, 2013¶
- Increase future compatibility for 2.6 authorization features :issue:`SERVER-11478`.
- Fix :dbcommand:`dbhash` cache issue for config servers :issue:`SERVER-11421`.
- All 2.4.8 improvements.
2.4.7 – October 21, 2013¶
- Fixed over-aggressive caching of V8 Isolates :issue:`SERVER-10596`.
- Removed extraneous initial count during mapReduce :issue:`SERVER-9907`.
- Cache results of dbhash command :issue:`SERVER-11021`.
- Fixed memory leak in aggregation :issue:`SERVER-10554`.
- All 2.4.7 improvements.
2.4.6 – August 20, 2013¶
- Fix for possible loss of documents during the chunk migration process if a document in the chunk is very large :issue:`SERVER-10478`.
- Fix for C++ client shutdown issues :issue:`SERVER-8891`.
- Improved replication robustness in presence of high network latency :issue:`SERVER-10085`.
- Improved Solaris support :issue:`SERVER-9832`, :issue:`SERVER-9786`, and :issue:`SERVER-7080`.
- All 2.4.6 improvements.
2.4.5 – July 3, 2013¶
- Fix for CVE-2013-4650 Improperly grant user system privileges on databases other than local :issue:`SERVER-9983`.
- Fix for CVE-2013-3969 Remotely triggered segmentation fault in Javascript engine :issue:`SERVER-9878`.
- Fix to prevent identical background indexes from being built :issue:`SERVER-9856`.
- Config server performance improvements :issue:`SERVER-9864` and :issue:`SERVER-5442`.
- Improved initial sync resilience to network failure :issue:`SERVER-9853`.
- All 2.4.5 improvements.
2.4.4 – June 4, 2013¶
- Performance fix for Windows version :issue:`SERVER-9721`
- Fix for config upgrade failure :issue:`SERVER-9661`.
- Migration to Cyrus SASL library for MongoDB Enterprise :issue:`SERVER-8813`.
- All 2.4.4 improvements.
2.4.3 – April 23, 2013¶
- Fix for mongo shell ignoring modified object’s _id field :issue:`SERVER-9385`.
- Fix for race condition in log rotation :issue:`SERVER-4739`.
- Fix for copydb command with authorization in a sharded cluster :issue:`SERVER-9093`.
- All 2.4.3 improvements.
2.4.2 – April 17, 2013¶
- Several V8 memory leak and performance fixes :issue:`SERVER-9267` and :issue:`SERVER-9230`.
- Fix for upgrading sharded clusters :issue:`SERVER-9125`.
- Fix for high volume connection crash :issue:`SERVER-9014`.
- All 2.4.2 improvements
2.4.1 – April 17, 2013¶
- Fix for losing index changes during initial sync :issue:`SERVER-9087`
- All 2.4.1 improvements.
Major New Features¶
The following changes in MongoDB affect both standard and Enterprise editions:
Text Search¶
Add support for text search of content in MongoDB databases as a beta feature. See /core/index-text for more information.
Geospatial Support Enhancements¶
- Add new 2dsphere index. The new index supports GeoJSON objects Point, LineString, and Polygon. See /core/2dsphere and /applications/geospatial-indexes.
- Introduce operators :query:`$geometry`, :query:`$geoWithin` and :query:`$geoIntersects` to work with the GeoJSON data.
Hashed Index¶
Add new hashed index to index documents using hashes of field values. When used to index a shard key, the hashed index ensures an evenly distributed shard key. See also sharding-hashed-sharding.
Improvements to the Aggregation Framework¶
- Improve support for geospatial queries. See the :query:`$geoWithin` operator and the :pipeline:`$geoNear` pipeline stage.
- Improve sort efficiency when the :pipeline:`$sort` stage immediately precedes a :pipeline:`$limit` in the pipeline.
- Add new operators :expression:`$millisecond` and :expression:`$concat` and modify how :group:`$min` operator processes null values.
Changes to Update Operators¶
- Add new :update:`$setOnInsert` operator for use with :method:`upsert <db.collection.update()>` .
- Enhance functionality of the :update:`$push` operator, supporting its use with the :update:`$each`, the :update:`$sort`, and the :update:`$slice` modifiers.
Additional Limitations for Map-Reduce and $where Operations¶
The :dbcommand:`mapReduce` command, :dbcommand:`group` command, and the :query:`$where` operator expressions cannot access certain global functions or properties, such as db, that are available in the mongo shell. See the individual command or operator for details.
Improvements to serverStatus Command¶
Provide additional metrics and customization for the :dbcommand:`serverStatus` command. See :method:`db.serverStatus()` and :dbcommand:`serverStatus` for more information.
Security Enhancements¶
- Introduce a role-based access control system :v2.4:`User Privileges </reference/user-privileges>` now use a new format for Privilege Documents.
- Enforce uniqueness of the user in user privilege documents per database. Previous versions of MongoDB did not enforce this requirement, and existing databases may have duplicates.
- Support encrypted connections using SSL certificates signed by a Certificate Authority. See /tutorial/configure-ssl.
For more information on security and risk management strategies, see MongoDB Security Practices and Procedures.
Performance Improvements¶
V8 JavaScript Engine¶
Change default JavaScript engine from SpiderMonkey to V8. The change provides improved concurrency for JavaScript operations, modernized JavaScript implementation, and the removal of non-standard SpiderMonkey features, and affects all JavaScript behavior including the commands :dbcommand:`mapReduce`, :dbcommand:`group`, and :dbcommand:`eval` and the query operator :query:`$where`.
See /release-notes/2.4-javascript for more information about all changes .
BSON Document Validation Enabled by Default for mongod and mongorestore¶
Enable basic BSON object validation for mongod and mongorestore when writing to MongoDB data files. See :setting:`~net.wireObjectCheck` for details.
Index Build Enhancements¶
- Add support for multiple concurrent index builds in the background by a single mongod instance. See building indexes in the background for more information on background index builds.
- Allow the :method:`db.killOp()` method to terminate a foreground index build.
- Improve index validation during index creation. See /release-notes/2.4-index-types for more information.
Set Parameters as Command Line Options¶
Provide --setParameter as a command line option for mongos and mongod. See mongod and mongos for list of available options for :setting:`setParameter`.
Changed Replication Behavior for Chunk Migration¶
By default, each document move during chunk migration in a sharded cluster propagates to at least one secondary before the balancer proceeds with its next operation. See chunk-migration-replication.
Improved Chunk Migration Queue Behavior¶
Increase performance for moving multiple chunks off an overloaded shard. The balancer no longer waits for the current migration’s delete phase to complete before starting the next chunk migration. See chunk-migration-queuing for details.
Enterprise¶
The following changes are specific to MongoDB Enterprise Editions:
SASL Library Change¶
In 2.4.4, MongoDB Enterprise uses Cyrus SASL. Earlier 2.4 Enterprise versions use GNU SASL (libgsasl). To upgrade to 2.4.4 MongoDB Enterprise or greater, you must install all package dependencies related to this change, including the appropriate Cyrus SASL GSSAPI library. See /administration/install-enterprise for details of the dependencies.
New Modular Authentication System with Support for Kerberos¶
In 2.4, the MongoDB Enterprise now supports authentication via a Kerberos mechanism. See /tutorial/control-access-to-mongodb-with-kerberos-authentication for more information. For drivers that provide support for Kerberos authentication to MongoDB, refer to kerberos-and-drivers.
For more information on security and risk management strategies, see MongoDB Security Practices and Procedures.
Additional Information¶
Platform Notes¶
For OS X, MongoDB 2.4 only supports OS X versions 10.6 (Snow Leopard) and later. There are no other platform support changes in MongoDB 2.4. See the downloads page for more information on platform support.
-
2.2
Discovered at April 17, 2013
Release Notes for MongoDB 2.2¶
Upgrading¶
MongoDB 2.2 is a production release series and succeeds the 2.0 production release series.
MongoDB 2.0 data files are compatible with 2.2-series binaries without any special migration process. However, always perform the upgrade process for replica sets and sharded clusters using the procedures that follow.
Synopsis¶
mongod, 2.2 is a drop-in replacement for 2.0 and 1.8.
Check your driver documentation for information regarding required compatibility upgrades, and always run the recent release of your driver.
Typically, only users running with authentication, will need to upgrade drivers before continuing with the upgrade to 2.2.
For all deployments using authentication, upgrade the drivers (i.e. client libraries), before upgrading the mongod instance or instances.
For all upgrades of sharded clusters:
- turn off the balancer during the upgrade process. See the sharding-balancing-disable-temporarily section for more information.
- upgrade all mongos instances before upgrading any mongod instances.
Other than the above restrictions, 2.2 processes can interoperate with 2.0 and 1.8 tools and processes. You can safely upgrade the mongod and mongos components of a deployment one by one while the deployment is otherwise operational. Be sure to read the detailed upgrade procedures below before upgrading production systems.
[1] To minimize the interruption caused by election process, always upgrade the secondaries of the set first, then :dbcommand:`step down <replSetStepDown>` the primary, and then upgrade the primary. Upgrading a Standalone mongod¶
- Download binaries of the latest release in the 2.2 series from the MongoDB Download Page.
- Shutdown your mongod instance. Replace the existing binary with the 2.2 mongod binary and restart MongoDB.
Upgrading a Replica Set¶
You can upgrade to 2.2 by performing a “rolling” upgrade of the set by upgrading the members individually while the other members are available to minimize downtime. Use the following procedure:
Upgrade the secondary members of the set one at a time by shutting down the mongod and replacing the 2.0 binary with the 2.2 binary. After upgrading a mongod instance, wait for the member to recover to SECONDARY state before upgrading the next instance. To check the member’s state, issue :method:`rs.status()` in the mongo shell.
Use the mongo shell method :method:`rs.stepDown()` to step down the primary to allow the normal failover procedure. :method:`rs.stepDown()` expedites the failover procedure and is preferable to shutting down the primary directly.
Once the primary has stepped down and another member has assumed PRIMARY state, as observed in the output of :method:`rs.status()`, shut down the previous primary and replace mongod binary with the 2.2 binary and start the new process.
Note
Replica set failover is not instant but will render the set unavailable to read or accept writes until the failover process completes. Typically this takes 10 seconds or more. You may wish to plan the upgrade during a predefined maintenance window.
Upgrading a Sharded Cluster¶
Use the following procedure to upgrade a sharded cluster:
- Disable the balancer.
- Upgrade all mongos instances first, in any order.
- Upgrade all of the mongod config server instances using the stand alone procedure. To keep the cluster online, be sure that at all times at least one config server is up.
- Upgrade each shard’s replica set, using the upgrade procedure for replica sets detailed above.
- re-enable the balancer.
Note
Balancing is not currently supported in mixed 2.0.x and 2.2.0 deployments. Thus you will want to reach a consistent version for all shards within a reasonable period of time, e.g. same-day. See :issue:`SERVER-6902` for more information.
Changes¶
Major Features¶
Aggregation Framework¶
The aggregation framework makes it possible to do aggregation operations without needing to use map-reduce. The :dbcommand:`aggregate` command exposes the aggregation framework, and the :method:`~db.collection.aggregate()` helper in the mongo shell provides an interface to these operations. Consider the following resources for background on the aggregation framework and its use:
- Documentation: /core/aggregation
- Reference: /reference/aggregation
- Examples: /applications/aggregation
TTL Collections¶
TTL collections remove expired data from a collection, using a special index and a background thread that deletes expired documents every minute. These collections are useful as an alternative to capped collections in some cases, such as for data warehousing and caching cases, including: machine generated event data, logs, and session information that needs to persist in a database for only a limited period of time.
For more information, see the /tutorial/expire-data tutorial.
Concurrency Improvements¶
MongoDB 2.2 increases the server’s capacity for concurrent operations with the following improvements:
- :issue:`DB Level Locking <SERVER-4328>`
- :issue:`Improved Yielding on Page Faults <SERVER-3357>`
- :issue:`Improved Page Fault Detection on Windows <SERVER-4538>`
To reflect these changes, MongoDB now provides changed and improved reporting for concurrency and use, see locks and server-status-record-stats in server status and see :method:`db.currentOp()`, mongotop, and mongostat.
Improved Data Center Awareness with Tag Aware Sharding¶
MongoDB 2.2 adds additional support for geographic distribution or other custom partitioning for sharded collections in clusters. By using this “tag aware” sharding, you can automatically ensure that data in a sharded database system is always on specific shards. For example, with tag aware sharding, you can ensure that data is closest to the application servers that use that data most frequently.
Shard tagging controls data location, and is complementary but separate from replica set tagging, which controls read preference and write concern. For example, shard tagging can pin all “USA” data to one or more logical shards, while replica set tagging can control which mongod instances (e.g. “production” or “reporting”) the application uses to service requests.
See the documentation for the following helpers in the mongo shell that support tagged sharding configuration:
Also, see /core/tag-aware-sharding and /tutorial/administer-shard-tags.
Fully Supported Read Preference Semantics¶
All MongoDB clients and drivers now support full read preferences, including consistent support for a full range of read preference modes and tag sets. This support extends to the mongos and applies identically to single replica sets and to the replica sets for each shard in a sharded cluster.
Additional read preference support now exists in the mongo shell using the :method:`~cursor.readPref()` cursor method.
Compatibility Changes¶
Authentication Changes¶
MongoDB 2.2 provides more reliable and robust support for authentication clients, including drivers and mongos instances.
If your cluster runs with authentication:
- For all drivers, use the latest release of your driver and check its release notes.
- In sharded environments, to ensure that your cluster remains available during the upgrade process you must use the upgrade procedure for sharded clusters.
findAndModify Returns Null Value for Upserts that Perform Inserts¶
In version 2.2, for upsert that perform inserts with the new option set to false, :dbcommand:`findAndModify` commands will now return the following output:
{ 'ok': 1.0, 'value': null }
In the mongo shell, upsert :dbcommand:`findAndModify` operations that perform inserts (with new set to false.)only output a null value.
In version 2.0 these operations would return an empty document, e.g. { }.
See: :issue:`SERVER-6226` for more information.
mongodump 2.2 Output Incompatible with Pre-2.2 mongorestore¶
If you use the mongodump tool from the 2.2 distribution to create a dump of a database, you must use a 2.2 (or later) version of mongorestore to restore that dump.
See: :issue:`SERVER-6961` for more information.
ObjectId().toString() Returns String Literal ObjectId("...")¶
In version 2.2, the :method:`~ObjectId.toString()` method returns the string representation of the ObjectId() object and has the format ObjectId("...").
Consider the following example that calls the :method:`~ObjectId.toString()` method on the ObjectId("507c7f79bcf86cd7994f6c0e") object:
ObjectId("507c7f79bcf86cd7994f6c0e").toString()
The method now returns the string ObjectId("507c7f79bcf86cd7994f6c0e").
Previously, in version 2.0, the method would return the hexadecimal string 507c7f79bcf86cd7994f6c0e.
If compatibility between versions 2.0 and 2.2 is required, use ObjectId().str, which holds the hexadecimal string value in both versions.
ObjectId().valueOf() Returns hexadecimal string¶
In version 2.2, the :method:`~ObjectId.valueOf()` method returns the value of the ObjectId() object as a lowercase hexadecimal string.
Consider the following example that calls the :method:`~ObjectId.valueOf()` method on the ObjectId("507c7f79bcf86cd7994f6c0e") object:
ObjectId("507c7f79bcf86cd7994f6c0e").valueOf()
The method now returns the hexadecimal string 507c7f79bcf86cd7994f6c0e.
Previously, in version 2.0, the method would return the object ObjectId("507c7f79bcf86cd7994f6c0e").
If compatibility between versions 2.0 and 2.2 is required, use ObjectId().str attribute, which holds the hexadecimal string value in both versions.
Behavioral Changes¶
Restrictions on Collection Names¶
In version 2.2, collection names cannot:
- contain the $.
- be an empty string (i.e. "").
This change does not affect collections created with now illegal names in earlier versions of MongoDB.
These new restrictions are in addition to the existing restrictions on collection names which are:
- A collection name should begin with a letter or an underscore.
- A collection name cannot contain the null character.
- Begin with the system. prefix. MongoDB reserves system. for system collections, such as the system.indexes collection.
- The maximum size of a collection name is 128 characters, including the name of the database. However, for maximum flexibility, collections should have names less than 80 characters.
Collections names may have any other valid UTF-8 string.
See the :issue:`SERVER-4442` and the faq-restrictions-on-collection-names FAQ item.
Restrictions on Database Names for Windows¶
Database names running on Windows can no longer contain the following characters:
/\. "*<>:|?
The names of the data files include the database name. If you attempt to upgrade a database instance with one or more of these characters, mongod will refuse to start.
Change the name of these databases before upgrading. See :issue:`SERVER-4584` and :issue:`SERVER-6729` for more information.
_id Fields and Indexes on Capped Collections¶
All capped collections now have an _id field by default, if they exist outside of the local database, and now have indexes on the _id field. This change only affects capped collections created with 2.2 instances and does not affect existing capped collections.
See: :issue:`SERVER-5516` for more information.
New $elemMatch Projection Operator¶
The :projection:`$elemMatch` operator allows applications to narrow the data returned from queries so that the query operation will only return the first matching element in an array. See the :projection:`$elemMatch` reference and the :issue:`SERVER-2238` and :issue:`SERVER-828` issues for more information.
Windows Specific Changes¶
Windows XP is Not Supported¶
As of 2.2, MongoDB does not support Windows XP. Please upgrade to a more recent version of Windows to use the latest releases of MongoDB. See :issue:`SERVER-5648` for more information.
Service Support for mongos.exe¶
You may now run mongos.exe instances as a Windows Service. See the mongos.exe reference and manually-create-windows-service and :issue:`SERVER-1589` for more information.
Log Rotate Command Support¶
MongoDB for Windows now supports log rotation by way of the :dbcommand:`logRotate` database command. See :issue:`SERVER-2612` for more information.
New Build Using SlimReadWrite Locks for Windows Concurrency¶
Labeled “2008+” on the Downloads Page, this build for 64-bit versions of Windows Server 2008 R2 and for Windows 7 or newer, offers increased performance over the standard 64-bit Windows build of MongoDB. See :issue:`SERVER-3844` for more information.
Tool Improvements¶
Index Definitions Handled by mongodump and mongorestore¶
When you specify the --collection option to mongodump, mongodump will now backup the definitions for all indexes that exist on the source database. When you attempt to restore this backup with mongorestore, the target mongod will rebuild all indexes. See :issue:`SERVER-808` for more information.
mongorestore now includes the --noIndexRestore option to provide the preceding behavior. Use --noIndexRestore to prevent mongorestore from building previous indexes.
mongooplog for Replaying Oplogs¶
The mongooplog tool makes it possible to pull oplog entries from mongod instance and apply them to another mongod instance. You can use mongooplog to achieve point-in-time backup of a MongoDB data set. See the :issue:`SERVER-3873` case and the mongooplog reference.
Authentication Support for mongotop and mongostat¶
mongotop and mongostat now contain support for username/password authentication. See :issue:`SERVER-3875` and :issue:`SERVER-3871` for more information regarding this change. Also consider the documentation of the following options for additional information:
- mongotop --username
- mongotop --password
- mongostat --username
- mongostat --password
Write Concern Support for mongoimport and mongorestore¶
mongoimport now provides an option to halt the import if the operation encounters an error, such as a network interruption, a duplicate key exception, or a write error. The --stopOnError option will produce an error rather than silently continue importing data. See :issue:`SERVER-3937` for more information.
In mongorestore, the --w option provides support for configurable write concern.
mongodump Support for Reading from Secondaries¶
You can now run mongodump when connected to a secondary member of a replica set. See :issue:`SERVER-3854` for more information.
mongoimport Support for full 16MB Documents¶
Previously, mongoimport would only import documents that were less than 4 megabytes in size. This issue is now corrected, and you may use mongoimport to import documents that are at least 16 megabytes ins size. See :issue:`SERVER-4593` for more information.
Timestamp() Extended JSON format¶
MongoDB extended JSON now includes a new Timestamp() type to represent the Timestamp type that MongoDB uses for timestamps in the oplog among other contexts.
This permits tools like mongooplog and mongodump to query for specific timestamps. Consider the following mongodump operation:
mongodump --db local --collection oplog.rs --query '{"ts":{"$gt":{"$timestamp" : {"t": 1344969612000, "i": 1 }}}}' --out oplog-dump
See :issue:`SERVER-3483` for more information.
Shell Improvements¶
Improved Shell User Interface¶
2.2 includes a number of changes that improve the overall quality and consistency of the user interface for the mongo shell:
- Full Unicode support.
- Bash-like line editing features. See :issue:`SERVER-4312` for more information.
- Multi-line command support in shell history. See :issue:`SERVER-3470` for more information.
- Windows support for the edit command. See :issue:`SERVER-3998` for more information.
Helper to load Server-Side Functions¶
The :method:`db.loadServerScripts()` loads the contents of the current database’s system.js collection into the current mongo shell session. See :issue:`SERVER-1651` for more information.
Support for Bulk Inserts¶
If you pass an array of documents to the :method:`~db.collection.insert()` method, the mongo shell will now perform a bulk insert operation. See :issue:`SERVER-3819` and :issue:`SERVER-2395` for more information.
Operations¶
Support for Logging to Syslog¶
See the :issue:`SERVER-2957` case and the documentation of the :setting:`~systemLog.syslogFacility` run-time option or the mongod --syslog and mongos --syslog command line-options.
touch Command¶
Added the :dbcommand:`touch` command to read the data and/or indexes from a collection into memory. See: :issue:`SERVER-2023` and :dbcommand:`touch` for more information.
indexCounters No Longer Report Sampled Data¶
:data:`indexCounters` now report actual counters that reflect index use and state. In previous versions, these data were sampled. See :issue:`SERVER-5784` and :data:`indexCounters` for more information.
Padding Specifiable on compact Command¶
See the documentation of the :dbcommand:`compact` and the :issue:`SERVER-4018` issue for more information.
Added Build Flag to Use System Libraries¶
The Boost library, version 1.49, is now embedded in the MongoDB code base.
If you want to build MongoDB binaries using system Boost libraries, you can pass scons using the --use-system-boost flag, as follows:
scons --use-system-boost
When building MongoDB, you can also pass scons a flag to compile MongoDB using only system libraries rather than the included versions of the libraries. For example:
scons --use-system-all
See the :issue:`SERVER-3829` and :issue:`SERVER-5172` issues for more information.
Memory Allocator Changed to TCMalloc¶
To improve performance, MongoDB 2.2 uses the TCMalloc memory allocator from Google Perftools. For more information about this change see the :issue:`SERVER-188` and :issue:`SERVER-4683`. For more information about TCMalloc, see the documentation of TCMalloc itself.
Replication¶
Improved Logging for Replica Set Lag¶
When secondary members of a replica set fall behind in replication, mongod now provides better reporting in the log. This makes it possible to track replication in general and identify what process may produce errors or halt replication. See :issue:`SERVER-3575` for more information.
Replica Set Members can Sync from Specific Members¶
The new :dbcommand:`replSetSyncFrom` command and new :method:`rs.syncFrom()` helper in the mongo shell make it possible for you to manually configure from which member of the set a replica will poll oplog entries. Use these commands to override the default selection logic if needed. Always exercise caution with :dbcommand:`replSetSyncFrom` when overriding the default behavior.
Replica Set Members will not Sync from Members Without Indexes Unless buildIndexes: false¶
To prevent inconsistency between members of replica sets, if the member of a replica set has :data:`~local.system.replset.members[n].buildIndexes` set to true, other members of the replica set will not sync from this member, unless they also have :data:`~local.system.replset.members[n].buildIndexes` set to true. See :issue:`SERVER-4160` for more information.
New Option To Configure Index Pre-Fetching during Replication¶
By default, when replicating options, secondaries will pre-fetch indexes associated with a query to improve replication throughput in most cases. The :setting:`replication.secondaryIndexPrefetch` setting and --replIndexPrefetch option allow administrators to disable this feature or allow the mongod to pre-fetch only the index on the _id field. See :issue:`SERVER-6718` for more information.
Map Reduce Improvements¶
In 2.2 Map Reduce received the following improvements:
Sharding Improvements¶
Index on Shard Keys Can Now Be a Compound Index¶
If your shard key uses the prefix of an existing index, then you do not need to maintain a separate index for your shard key in addition to your existing index. This index, however, cannot be a multi-key index. See the sharding-shard-key-indexes documentation and :issue:`SERVER-1506` for more information.
Migration Thresholds Modified¶
The migration thresholds have changed in 2.2 to permit more even distribution of chunks in collections that have smaller quantities of data. See the sharding-migration-thresholds documentation for more information.
Licensing Changes¶
Added License notice for Google Perftools (TCMalloc Utility). See the License Notice and the :issue:`SERVER-4683` for more information.
-
2.0
Discovered at April 17, 2013
Release Notes for MongoDB 2.0¶
Upgrading¶
Although the major version number has changed, MongoDB 2.0 is a standard, incremental production release and works as a drop-in replacement for MongoDB 1.8.
Preparation¶
Read through all release notes before upgrading, and ensure that no changes will affect your deployment.
If you create new indexes in 2.0, then downgrading to 1.8 is possible but you must reindex the new collections.
mongoimport and mongoexport now correctly adhere to the CSV spec for handling CSV input/output. This may break existing import/export workflows that relied on the previous behavior. For more information see :issue:`SERVER-1097`.
Journaling is enabled by default in 2.0 for 64-bit builds. If you still prefer to run without journaling, start mongod with the --nojournal run-time option. Otherwise, MongoDB creates journal files during startup. The first time you start mongod with journaling, you will see a delay as mongod creates new files. In addition, you may see reduced write throughput.
2.0 mongod instances are interoperable with 1.8 mongod instances; however, for best results, upgrade your deployments using the following procedures:
Upgrading a Standalone mongod¶
- Download the v2.0.x binaries from the MongoDB Download Page.
- Shutdown your mongod instance. Replace the existing binary with the 2.0.x mongod binary and restart MongoDB.
Upgrading a Replica Set¶
Upgrade the secondary members of the set one at a time by shutting down the mongod and replacing the 1.8 binary with the 2.0.x binary from the MongoDB Download Page.
To avoid losing the last few updates on failover you can temporarily halt your application (failover should take less than 10 seconds), or you can set write concern in your application code to confirm that each update reaches multiple servers.
Use the :method:`rs.stepDown()` to step down the primary to allow the normal failover procedure.
:method:`rs.stepDown()` and :dbcommand:`replSetStepDown` provide for shorter and more consistent failover procedures than simply shutting down the primary directly.
When the primary has stepped down, shut down its instance and upgrade by replacing the mongod binary with the 2.0.x binary.
Upgrading a Sharded Cluster¶
- Upgrade all config server instances first, in any order. Since config servers use two-phase commit, shard configuration metadata updates will halt until all are up and running.
- Upgrade mongos routers in any order.
Changes¶
Compact Command¶
A :dbcommand:`compact` command is now available for compacting a single collection and its indexes. Previously, the only way to compact was to repair the entire database.
Concurrency Improvements¶
When going to disk, the server will yield the write lock when writing data that is not likely to be in memory. The initial implementation of this feature now exists:
See :issue:`SERVER-2563` for more information.
The specific operations yield in 2.0 are:
- Updates by _id
- Removes
- Long cursor iterations
Default Stack Size¶
MongoDB 2.0 reduces the default stack size. This change can reduce total memory usage when there are many (e.g., 1000+) client connections, as there is a thread per connection. While portions of a thread’s stack can be swapped out if unused, some operating systems do this slowly enough that it might be an issue. The default stack size is lesser of the system setting or 1MB.
Index Performance Enhancements¶
v2.0 includes significant improvements to the index. Indexes are often 25% smaller and 25% faster (depends on the use case). When upgrading from previous versions, the benefits of the new index type are realized only if you create a new index or re-index an old one.
Dates are now signed, and the max index key size has increased slightly from 819 to 1024 bytes.
All operations that create a new index will result in a 2.0 index by default. For example:
- Reindexing results on an older-version index results in a 2.0 index. However, reindexing on a secondary does not work in versions prior to 2.0. Do not reindex on a secondary. For a workaround, see :issue:`SERVER-3866`.
- The :dbcommand:`repairDatabase` command converts indexes to a 2.0 indexes.
To convert all indexes for a given collection to the 2.0 type, invoke the :dbcommand:`compact` command.
Once you create new indexes, downgrading to 1.8.x will require a re-index of any indexes created using 2.0. See /tutorial/roll-back-to-v1.8-index.
Sharding Authentication¶
Applications can now use authentication with sharded clusters.
Replica Sets¶
Hidden Nodes in Sharded Clusters¶
In 2.0, mongos instances can now determine when a member of a replica set becomes “hidden” without requiring a restart. In 1.8, mongos if you reconfigured a member as hidden, you had to restart mongos to prevent queries from reaching the hidden member.
Priorities¶
Each replica set member can now have a priority value consisting of a floating-point from 0 to 1000, inclusive. Priorities let you control which member of the set you prefer to have as primary the member with the highest priority that can see a majority of the set will be elected primary.
For example, suppose you have a replica set with three members, A, B, and C, and suppose that their priorities are set as follows:
- A‘s priority is 2.
- B‘s priority is 3.
- C‘s priority is 1.
During normal operation, the set will always chose B as primary. If B becomes unavailable, the set will elect A as primary.
For more information, see the :data:`~local.system.replset.members[n].priority` documentation.
Data-Center Awareness¶
You can now “tag” replica set members to indicate their location. You can use these tags to design custom write rules across data centers, racks, specific servers, or any other architecture choice.
For example, an administrator can define rules such as “very important write” or customerData or “audit-trail” to replicate to certain servers, racks, data centers, etc. Then in the application code, the developer would say:
db.foo.insert(doc, {w : "very important write"})
which would succeed if it fulfilled the conditions the DBA defined for “very important write”.
For more information, see /data-center-awareness.
Drivers may also support tag-aware reads. Instead of specifying slaveOk, you specify slaveOk with tags indicating which data-centers to read from. For details, see the :ecosystem:`Drivers </drivers>` documentation.
w : majority¶
You can also set w to majority to ensure that the write propagates to a majority of nodes, effectively committing it. The value for “majority” will automatically adjust as you add or remove nodes from the set.
For more information, see /core/write-concern.
Reconfiguration with a Minority Up¶
If the majority of servers in a set has been permanently lost, you can now force a reconfiguration of the set to bring it back online.
For more information see /tutorial/reconfigure-replica-set-with-unavailable-members.
Primary Checks for a Caught up Secondary before Stepping Down¶
To minimize time without a primary, the :method:`rs.stepDown()` method will now fail if the primary does not see a secondary within 10 seconds of its latest optime. You can force the primary to step down anyway, but by default it will return an error message.
See also /tutorial/force-member-to-be-primary.
Extended Shutdown on the Primary to Minimize Interruption¶
When you call the :dbcommand:`shutdown` command, the primary will refuse to shut down unless there is a secondary whose optime is within 10 seconds of the primary. If such a secondary isn’t available, the primary will step down and wait up to a minute for the secondary to be fully caught up before shutting down.
Note that to get this behavior, you must issue the :dbcommand:`shutdown` command explicitly; sending a signal to the process will not trigger this behavior.
You can also force the primary to shut down, even without an up-to-date secondary available.
Maintenance Mode¶
When :dbcommand:`repair` or :dbcommand:`compact` runs on a secondary, the secondary will automatically drop into “recovering” mode until the operation finishes. This prevents clients from trying to read from it while it’s busy.
Geospatial Features¶
Multi-Location Documents¶
Indexing is now supported on documents which have multiple location objects, embedded either inline or in embedded documents. Additional command options are also supported, allowing results to return with not only distance but the location used to generate the distance.
For more information, see geospatial-indexes-multi-location.
Polygon searches¶
Polygonal :query:`$within` queries are also now supported for simple polygon shapes. For details, see the :query:`$within` operator documentation.
Journaling Enhancements¶
- Journaling is now enabled by default for 64-bit platforms. Use the --nojournal command line option to disable it.
- The journal is now compressed for faster commits to disk.
- A new --journalCommitInterval run-time option exists for specifying your own group commit interval. The default settings do not change.
- A new :dbcommand:`{ getLastError: { j: true } } <getLastError>` option is available to wait for the group commit. The group commit will happen sooner when a client is waiting on {j: true}. If journaling is disabled, {j: true} is a no-op.
New ContinueOnError Option for Bulk Insert¶
Set the continueOnError option for bulk inserts, in the driver, so that bulk insert will continue to insert any remaining documents even if an insert fails, as is the case with duplicate key exceptions or network interruptions. The :dbcommand:`getLastError` command will report whether any inserts have failed, not just the last one. If multiple errors occur, the client will only receive the most recent :dbcommand:`getLastError` results.
Map Reduce¶
Output to a Sharded Collection¶
Using the new sharded flag, it is possible to send the result of a map/reduce to a sharded collection. Combined with the reduce or merge flags, it is possible to keep adding data to very large collections from map/reduce jobs.
For more information, see /core/map-reduce/ and the :dbcommand:`mapReduce` reference.
Performance Improvements¶
Map/reduce performance will benefit from the following:
- Larger in-memory buffer sizes, reducing the amount of disk I/O needed during a job
- Larger javascript heap size, allowing for larger objects and less GC
- Supports pure JavaScript execution with the jsMode flag. See the :dbcommand:`mapReduce` reference.
New Querying Features¶
Additional regex options: s¶
Allows the dot (.) to match all characters including new lines. This is in addition to the currently supported i, m and x. See :query:`$regex`.
$and¶
A special boolean :query:`$and` query operator is now available.
Command Output Changes¶
The output of the :dbcommand:`validate` command and the documents in the system.profile collection have both been enhanced to return information as BSON objects with keys for each value rather than as free-form strings.
Shell Features¶
Custom Prompt¶
You can define a custom prompt for the mongo shell. You can change the prompt at any time by setting the prompt variable to a string or a custom JavaScript function returning a string. For examples, see shell-use-a-custom-prompt.
Default Shell Init Script¶
On startup, the shell will check for a .mongorc.js file in the user’s home directory. The shell will execute this file after connecting to the database and before displaying the prompt.
If you would like the shell not to run the .mongorc.js file automatically, start the shell with --norc.
For more information, see the mongo reference.
Most Commands Require Authentication¶
In 2.0, when running with authentication (e.g. :setting:`~security.authorization`) all database commands require authentication, except the following commands.
-
1.8.1
Discovered at April 17, 2013
- Sharding migrate fix when moving larger chunks.
- Durability fix with background indexing.
- Fixed mongos concurrency issue with many incoming connections.
-
1.8
Discovered at April 17, 2013
Release Notes for MongoDB 1.8¶
Upgrading¶
MongoDB 1.8 is a standard, incremental production release and works as a drop-in replacement for MongoDB 1.6, except:
- Replica set members should be upgraded in a particular order, as described in Upgrading a Replica Set.
- The :dbcommand:`mapReduce` command has changed in 1.8, causing incompatibility with previous releases. :dbcommand:`mapReduce` no longer generates temporary collections (thus, keepTemp has been removed). Now, you must always supply a value for out. See the out field options in the :dbcommand:`mapReduce` document. If you use MapReduce, this also likely means you need a recent version of your client driver.
Preparation¶
Read through all release notes before upgrading and ensure that no changes will affect your deployment.
Upgrading a Standalone mongod¶
- Download the v1.8.x binaries from the MongoDB Download Page.
- Shutdown your mongod instance.
- Replace the existing binary with the 1.8.x mongod binary.
- Restart MongoDB.
Upgrading a Replica Set¶
1.8.x secondaries can replicate from 1.6.x primaries.
1.6.x secondaries cannot replicate from 1.8.x primaries.
Thus, to upgrade a replica set you must replace all of your secondaries first, then the primary.
For example, suppose you have a replica set with a primary, an arbiter and several secondaries. To upgrade the set, do the following:
For the arbiter:
- Shut down the arbiter.
- Restart it with the 1.8.x binary from the MongoDB Download Page.
Change your config (optional) to prevent election of a new primary.
It is possible that, when you start shutting down members of the set, a new primary will be elected. To prevent this, you can give all of the secondaries a priority of 0 before upgrading, and then change them back afterwards. To do so:
Record your current config. Run :method:`rs.config()` and paste the results into a text file.
Update your config so that all secondaries have priority 0. For example:
config = rs.conf() { "_id" : "foo", "version" : 3, "members" : [ { "_id" : 0, "host" : "ubuntu:27017" }, { "_id" : 1, "host" : "ubuntu:27018" }, { "_id" : 2, "host" : "ubuntu:27019", "arbiterOnly" : true } { "_id" : 3, "host" : "ubuntu:27020" }, { "_id" : 4, "host" : "ubuntu:27021" }, ] } config.version++ 3 rs.isMaster() { "setName" : "foo", "ismaster" : false, "secondary" : true, "hosts" : [ "ubuntu:27017", "ubuntu:27018" ], "arbiters" : [ "ubuntu:27019" ], "primary" : "ubuntu:27018", "ok" : 1 } // for each secondary config.members[0].priority = 0 config.members[3].priority = 0 config.members[4].priority = 0 rs.reconfig(config)
For each secondary:
- Shut down the secondary.
- Restart it with the 1.8.x binary from the MongoDB Download Page.
If you changed the config, change it back to its original state:
config = rs.conf() config.version++ config.members[0].priority = 1 config.members[3].priority = 1 config.members[4].priority = 1 rs.reconfig(config)
Shut down the primary (the final 1.6 server), and then restart it with the 1.8.x binary from the MongoDB Download Page.
Upgrading a Sharded Cluster¶
Turn off the balancer:
mongo <a_mongos_hostname> use config db.settings.update({_id:"balancer"},{$set : {stopped:true}}, true)
For each shard:
- If the shard is a replica set, follow the directions above for Upgrading a Replica Set.
- If the shard is a single mongod process, shut it down and then restart it with the 1.8.x binary from the MongoDB Download Page.
For each mongos:
- Shut down the mongos process.
- Restart it with the 1.8.x binary from the MongoDB Download Page.
For each config server:
- Shut down the config server process.
- Restart it with the 1.8.x binary from the MongoDB Download Page.
Turn on the balancer:
use config db.settings.update({_id:"balancer"},{$set : {stopped:false}})
Returning to 1.6¶
If for any reason you must move back to 1.6, follow the steps above in reverse. Please be careful that you have not inserted any documents larger than 4MB while running on 1.8 (where the max size has increased to 16MB). If you have you will get errors when the server tries to read those documents.
Journaling¶
Returning to 1.6 after using 1.8 Journaling works fine, as journaling does not change anything about the data file format. Suppose you are running 1.8.x with journaling enabled and you decide to switch back to 1.6. There are two scenarios:
- If you shut down cleanly with 1.8.x, just restart with the 1.6 mongod binary.
- If 1.8.x shut down uncleanly, start 1.8.x up again and let the journal files run to fix any damage (incomplete writes) that may have existed at the crash. Then shut down 1.8.x cleanly and restart with the 1.6 mongod binary.
Changes¶
Journaling¶
MongoDB now supports write-ahead /core/journaling to facilitate fast crash recovery and durability in the storage engine. With journaling enabled, a mongod can be quickly restarted following a crash without needing to repair the collections. The aggregation framework makes it possible to do aggregation
Sparse and Covered Indexes¶
Sparse Indexes are indexes that only include documents that contain the fields specified in the index. Documents missing the field will not appear in the index at all. This can significantly reduce index size for indexes of fields that contain only a subset of documents within a collection.
Covered Indexes enable MongoDB to answer queries entirely from the index when the query only selects fields that the index contains.
Incremental MapReduce Support¶
The :dbcommand:`mapReduce` command supports new options that enable incrementally updating existing collections. Previously, a MapReduce job could output either to a temporary collection or to a named permanent collection, which it would overwrite with new data.
You now have several options for the output of your MapReduce jobs:
- You can merge MapReduce output into an existing collection. Output from the Reduce phase will replace existing keys in the output collection if it already exists. Other keys will remain in the collection.
- You can now re-reduce your output with the contents of an existing collection. Each key output by the reduce phase will be reduced with the existing document in the output collection.
- You can replace the existing output collection with the new results of the MapReduce job (equivalent to setting a permanent output collection in previous releases)
- You can compute MapReduce inline and return results to the caller without persisting the results of the job. This is similar to the temporary collections generated in previous releases, except results are limited to 8MB.
For more information, see the out field options in the :dbcommand:`mapReduce` document.
Additional Changes and Enhancements¶
1.8.1¶
- Sharding migrate fix when moving larger chunks.
- Durability fix with background indexing.
- Fixed mongos concurrency issue with many incoming connections.
1.8.0¶
- All changes from 1.7.x series.
1.7.6¶
- Bug fixes.
1.7.5¶
- Journaling.
- Extent allocation improvements.
- Improved replica set connectivity for mongos.
- :dbcommand:`getLastError` improvements for sharding.
1.7.4¶
- mongos routes slaveOk queries to secondaries in replica sets.
- New :dbcommand:`mapReduce` output options.
- index-type-sparse.
1.7.3¶
- Initial covered index support.
- Distinct can use data from indexes when possible.
- :dbcommand:`mapReduce` can merge or reduce results into an existing collection.
- mongod tracks and mongostat displays network usage. See mongostat.
- Sharding stability improvements.
1.7.2¶
- :update:`$rename` operator allows renaming of fields in a document.
- :method:`db.eval()` not to block.
- Geo queries with sharding.
- mongostat --discover option
- Chunk splitting enhancements.
- Replica sets network enhancements for servers behind a nat.
1.7.1¶
- Many sharding performance enhancements.
- Better support for :projection:`$elemMatch` on primitives in embedded arrays.
- Query optimizer enhancements on range queries.
- Window service enhancements.
- Replica set setup improvements.
- :update:`$pull` works on primitives in arrays.
1.7.0¶
- Sharding performance improvements for heavy insert loads.
- Slave delay support for replica sets.
- :data:`~local.system.replset.settings.getLastErrorDefaults` for replica sets.
- Auto completion in the shell.
- Spherical distance for geo search.
- All fixes from 1.6.1 and 1.6.2.
-
1.8.0
Discovered at April 17, 2013
- All changes from 1.7.x series.
-
1.6
Discovered at April 17, 2013
Release Notes for MongoDB 1.6¶
Upgrading¶
MongoDB 1.6 is a drop-in replacement for 1.4. To upgrade, simply shutdown mongod then restart with the new binaries.
Please note that you should upgrade to the latest version of whichever driver you’re using. Certain drivers, including the Ruby driver, will require the upgrade, and all the drivers will provide extra features for connecting to replica sets.
Sharding¶
/sharding is now production-ready, making MongoDB horizontally scalable, with no single point of failure. A single instance of mongod can now be upgraded to a distributed cluster with zero downtime when the need arises.
- /sharding
- /tutorial/deploy-shard-cluster
- /tutorial/convert-replica-set-to-replicated-shard-cluster
Replica Sets¶
Replica sets, which provide automated failover among a cluster of n nodes, are also now available.
Please note that replica pairs are now deprecated; we strongly recommend that replica pair users upgrade to replica sets.
- /replication
- /tutorial/deploy-replica-set
- /tutorial/convert-standalone-to-replica-set
Other Improvements¶
- The w option (and wtimeout) forces writes to be propagated to n servers before returning success (this works especially well with replica sets)
- $or queries
- Improved concurrency
- $slice operator for returning subsets of arrays
- 64 indexes per collection (formerly 40 indexes per collection)
- 64-bit integers can now be represented in the shell using NumberLong
- The :dbcommand:`findAndModify` command now supports upserts. It also allows you to specify fields to return
- $showDiskLoc option to see disk location of a document
- Support for IPv6 and UNIX domain sockets
Installation¶
- Windows service improvements
- The C++ client is a separate tarball from the binaries
-
1.4
Discovered at April 17, 2013
Release Notes for MongoDB 1.4¶
Upgrading¶
We’re pleased to announce the 1.4 release of MongoDB. 1.4 is a drop-in replacement for 1.2. To upgrade you just need to shutdown mongod, then restart with the new binaries. (Users upgrading from release 1.0 should review the 1.2 release notes, in particular the instructions for upgrading the DB format.)
Release 1.4 includes the following improvements over release 1.2:
Core Server Enhancements¶
- concurrency improvements
- indexing memory improvements
- background index creation
- better detection of regular expressions so the index can be used in more cases
Replication and Sharding¶
- better handling for restarting slaves offline for a while
- fast new slaves from snapshots (--fastsync)
- configurable slave delay (--slavedelay)
- replication handles clock skew on master
- $inc replication fixes
- sharding alpha 3 - notably 2-phase commit on config servers
Deployment and Production¶
- configure “slow threshold” for profiling
- ability to do fsync + lock for backing up raw files
- option for separate directory per db (--directoryperdb)
- http://localhost:28017/_status to get serverStatus via http
- REST interface is off by default for security (--rest to enable)
- can rotate logs with a db command, logRotate
- enhancements to serverStatus command (db.serverStatus()) - counters and replication lag stats
- new mongostat tool
Query Language Improvements¶
- $all with regex
- $not
- partial matching of array elements $elemMatch
- $ operator for updating arrays
- $addToSet
- $unset
- $pull supports object matching
- $set with array indexes
Geo¶
- 2d geospatial search
- geo $center and $box searches
-
1.2
Discovered at April 17, 2013
Release Notes for MongoDB 1.2.x¶
New Features¶
- More indexes per collection
- Faster index creation
- Map/Reduce
- Stored JavaScript functions
- Configurable fsync time
- Several small features and fixes
DB Upgrade Required¶
There are some changes that will require doing an upgrade if your previous version is <= 1.0.x. If you’re already using a version >= 1.1.x then these changes aren’t required. There are 2 ways to do it:
- --upgrade
- stop your mongod process
- run ./mongod --upgrade
- start mongod again
- use a slave
- start a slave on a different port and data directory
- when its synced, shut down the master, and start the new slave on the regular port.
Ask in the forums or IRC for more help.
Replication Changes¶
- There have been minor changes in replication. If you are upgrading a master/slave setup from <= 1.1.2 you have to update the slave first.
mongoimport¶
- mongoimportjson has been removed and is replaced with mongoimport that can do json/csv/tsv
field filter changing¶
- We’ve changed the semantics of the field filter a little bit. Previously only objects with those fields would be returned. Now the field filter only changes the output, not which objects are returned. If you need that behavior, you can use $exists