On this page本页内容
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.
lsn
file) may be ahead of what is synced to the data files:
SERVER-22261.mongos
to detect replica set failover and correctly route read operations to the new primary SERVER-18280getMore
operation in db.currentOp()
and the database profiler SERVER-16265mongos
SERVER-11980system.profile
collection SERVER-18211mongos
instances SERVER-17441_id
queries in sharded clusters SERVER-17426geoNear
command queries with multiple 2dsphere
indexes SERVER-14723listCollections
command functionality to 2.6 shell and client SERVER-17087copydb
/clone
commands can crash the server if a primary steps down SERVER-16599mongos
memory footprint when shards have several tags SERVER-16683/etc/init.d/mongod
startup script failure with dirname message SERVER-16081mongos
can cause shards to hit the in-memory sort limit by requesting more results than needed SERVER-14306mongod
SERVER-15580mongod
crashes with segfault when added to a 2.8 replica set with 12 or more members SERVER-16107$regex
, $in
and $sort
with index returns too many results SERVER-15696moveChunk
will fail if there is data on the target shard and a required index does not exist. SERVER-12472$rename
now uses correct dotted source paths SERVER-15029.ns
files on creation SERVER-15369text
index where under specific circumstances, in-place updates to a text
-indexed field may result in incorrect/incomplete results SERVER-14738_id
with projection may return no results on sharded collections SERVER-14302._id
with projection on _id
may return orphan documents on sharded collections SERVER-14304.mongod
may terminate if x.509 authentication certificate is invalid SERVER-13753.mongos
incorrectly targets multiple shards for nested field shard key predicates SERVER-14138.rs.stepDown()
during mapReduce causes fassert
when writing to op log SERVER-14186.--install
option SERVER-13515.yum
SERVER-13563.The following changes in MongoDB affect both the standard and Enterprise editions:
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.
db.collection.aggregate()
now returns a cursor, which enables the aggregation pipeline to return result sets of any size.explain
operation to aid analysis of aggregation operations.Text search is now enabled by default, and the query system, including the aggregation pipeline $match
stage, includes the $text
operator, which resolves text-search queries.
MongoDB 2.6 includes an updated text index format and deprecates the text
command.
Improvements to the update and insert systems include additional operations and improvements that increase consistency of modified data.
_id
field is always the first field in the document.renaming
of field names may result in the reordering of fields in the document.$bit
operator supports bitwise xor
operation.$min
and $max
operators that perform conditional update depending on the relative size of the specified value and the current value of a field.$push
operator has enhanced support for the $sort
, $slice
, and $each
modifiers and supports a new $position
modifier.$currentDate
operator to set the value of a field to the current date.$mul
operator for multiplicative increments for insert and update operations.See also参阅
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 insert
, update
, and 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 Bulk()
for more information.
See also参阅
MongoDB now distributes MSI packages for Microsoft Windows. This is the recommended method for MongoDB installation under Windows.
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:
admin
database and provides a new set of commands for managing users and roles.mongod
and mongos
instances using SSL connections.mongod
or mongos
at startup.enabled
.See also参阅
New Authorization Model, SSL Certificate Hostname Validation, and Security Checklist.
count()
with hint()
. See count()
for details.$or
expressions.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.mongod
instance will now restart the interrupted index build when the instance restarts.To disable this behavior, use the --noIndexBuildRetry
command-line option.
ensureIndex()
now wraps a new createIndex
command.dropDups
option to ensureIndex()
and createIndex
is deprecated.See also参阅
cleanupOrphaned
command to remove orphaned documents from a shard.mergeChunks
command to combine contiguous chunks located on a single shard. See mergeChunks
and Merge Chunks in a Sharded Cluster.rs.printReplicationInfo()
and 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.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.
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:
collMod
with usePowerOf2Sizes
set to false
.mongod
instance, set newCollectionsUsePowerOf2Sizes
to false
.
New collections include those: created during initial sync, as well as those created by the mongorestore
and mongoimport
tools, by running mongod
with the --repair
option, as well as the restoreDatabase
command.
See /core/storage for more information about MongoDB’s storage system.
maxIncomingConnections
for mongod
and mongos
. Previous versions capped the maximum possible maxIncomingConnections
setting at 20,000
connections.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.isMaster
command instead of replSetGetStatus
. This allows the C++ driver to support systems that require authentication.cursor.maxTimeMS()
and corresponding maxTimeMS
option for commands to specify a time limit.mongo
shell supports a global /etc/mongorc.js.--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 <mongoexport
option.mongostat
can support the use of --rowcount
(-n
) with the --discover
option to produce the specified number of output lines.data_numberlong
for use by mongoexport
and mongoimport
.The following changes are specific to MongoDB Enterprise Editions:
MongoDB Enterprise for Windows is now available. It includes support for Kerberos, SSL, and SNMP.
MongoDB Enterprise for Windows does not include LDAP support for authentication. However, MongoDB Enterprise for Linux supports using LDAP authentication with an ActiveDirectory server.
MongoDB Enterprise for Windows includes OpenSSL version 1.0.1g.
MongoDB Enterprise adds auditing capability for mongod
and mongos
instances. See Auditing for details.
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 Authenticate Using SASL and LDAP with OpenLDAP and Authenticate Using SASL and LDAP with ActiveDirectory for details.
MongoDB Enterprise for Windows does not include LDAP support for authentication. However, MongoDB Enterprise for Linux supports using LDAP authentication with an ActiveDirectory server.
MongoDB does not support LDAP authentication in mixed sharded cluster deployments that contain both version 2.4 and version 2.6 shards. See Upgrade MongoDB to 2.6 for upgrade instructions.
MongoDB Enterprise has greatly expanded its SNMP support to provide SNMP access to nearly the full range of metrics provided by db.serverStatus()
.
See also参阅
Some changes in 2.6 can affect compatibility and may require user actions. The 2.6 mongo
shell provides a db.upgradeCheckAllDBs() method to perform a check for upgrade preparedness for some of these changes.
See Compatibility Changes in MongoDB 2.6 for a detailed list of compatibility changes.
See also参阅
See Upgrade MongoDB to 2.6 for full upgrade instructions.
To download MongoDB 2.6, go to the downloads page.