## See also: 

SNMP Changes (page 861) 

## Additional Information 

## Changes Affecting Compatibility 

Compatibility Changes in MongoDB 2.6 The following 2.6 changes can affect the compatibility with older ver- sions of MongoDB. See Release Notes for MongoDB 2.6 (page 827) for the full list of the 2.6 changes. 

## Index Changes 

## Enforce Index Key Length Limit 

Description MongoDB 2.6 implements a stronger enforcement of the limit on index key . 

Creating indexes will error if an index key in an existing document exceeds the limit: 

• db.collection.ensureIndex() , db.collection.reIndex() , compact , and repairDatabase will error and not create the index. Previous versions of MongoDB would create the index but not index such documents. 

• Because db.collection.reIndex() , compact , and repairDatabase drop all the indexes from a collection and then recreate them sequentially, the error from the index key limit prevents these oper- ations from rebuilding any remaining indexes for the collection and, in the case of the repairDatabase command, from continuing with the remainder of the process. 

Inserts will error: 

• db.collection.insert() and other operations that perform inserts (e.g. db.collection.save() and db.collection.update() with upsert that result in in- serts) will fail to insert if the new document has an indexed field whose corresponding index entry exceeds the limit. Previous versions of MongoDB would insert but not index such documents. 

• mongorestore and mongoimport will fail to insert if the new document has an indexed field whose corresponding index entry exceeds the limit. 

Updates will error: 

• db.collection.update() and db.collection.save() operations on an indexed field will error if the updated value causes the index entry to exceed the limit. 

• If an existing document contains an indexed field whose index entry exceeds the limit, updates on other fields that result in the relocation of a document on disk will error. 

Chunk Migration will fail: 

• Migrations will fail for a chunk that has a document with an indexed field whose index entry exceeds the limit. 

• If left unfixed, the chunk will repeatedly fail migration, effectively ceasing chunk balancing for that col- lection. Or, if chunk splits occur in response to the migration failures, this response would lead to unnec- essarily large number of chunks and an overly large config databases. 

Secondary members of replica sets will warn: 

• Secondaries will continue to replicate documents with an indexed field whose corresponding index entry exceeds the limit on initial sync but will print warnings in the logs. 

