On this page本页内容
The following 3.2 changes can affect the compatibility with older versions of MongoDB. See also Release Notes for MongoDB 3.2 for the list of the 3.2 changes.
Starting in 3.2, MongoDB uses the WiredTiger as the default storage engine. Previous versions used the MMAPv1 as the default storage engine.
For existing deployments, if you do not specify the --storageEngine
or the storage.engine
setting, MongoDB automatically determines the storage engine used to create the data files in the --dbpath
or storage.dbPath
.
For new deployments, to use MMAPv1, you must explicitly specify the storage engine setting either:
--storageEngine
option:
storage.engine
setting:
MongoDB 3.2 disallows the creation of version 0 indexes (i.e. {v:
0}
). If version 0 indexes exist, MongoDB 3.2 outputs a warning log message, specifying the collection and the index.
Starting in MongoDB 2.0, MongoDB started automatically upgrading v:
0
indexes during initial sync, mongorestore
or reIndex
operations.
If a version 0 index exists, you can use any of the aforementioned operations as well as drop and recreate the index to upgrade to the v: 1
version.
For example, if upon startup, a warning message indicated that an index index { v: 0, key: { x: 1.0 }, name: "x_1", ns: "test.legacyOrders" }
is a version 0 index, to upgrade to the appropriate version, you can drop and recreate the index:
or by key:
v
:
Text index (version 3) is incompatible with earlier versions of MongoDB. Earlier versions of MongoDB will not start if text index (version 3) exists in the database.
2dsphere
Index Version 3 Compatibility¶2dsphere index (version 3) is incompatible with earlier versions of MongoDB. Earlier versions of MongoDB will not start if 2dsphere
index (version 3) exists in the database.
$avg
accumulator returns null when run against a non-existent field. Previous versions returned 0
.$substr
errors when the result is an invalid UTF-8. Previous versions output the invalid UTF-8 result.$literal
operator to create a literal value.$unwind
no longer errors on non-array operands. If the operand does not resolve to an array but is not missing, null, or an empty array, $unwind
treats the operand as a single element array. Previously, if a value in the field specified by the field path was not an array, db.collection.aggregate()
generated an error.MongoDB 3.2 changes the JavaScript engine from V8 to SpiderMonkey. The change allows the use of more modern JavaScript language features, and comes along with minor mongo
shell improvements and compatibility changes.
See JavaScript Changes in MongoDB 3.2 for more information about this change.
MongoDB 3.2 provides a stricter validation of replica set configuration settings:
A driver upgrade is necessary to support the find
and getMore
commands.
cursor.showDiskLoc()
is deprecated in favor of cursor.showRecordId()
, and both return a new document format.serverStatus.repl.slaves
field to repl.replicationProgress
. See: the db.serverStatus() repl reference for more information.--moveParanoia
to --noMoveParanoia
.1 vote
cannot sync from members with 0 votes
.mongooplog
is deprecated starting in MongoDB 3.2.See also Release Notes for MongoDB 3.2.