-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
ALL
-
This bug appears to be a regression from SERVER-8192. In 2.6.1, documents that contain parallel arrays in distinct sub-documents are not allowed to be inserted when a corresponding index is present:
2.6.1:
> var myDB = db.getSiblingDB('btree'); > myDB.dropDatabase(); { "dropped" : "btree", "ok" : 1 } > myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1}); { "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 } > myDB.foo.insert({a: {a: [1]}, b: {a: [1]}}); WriteResult({ "nInserted" : 0, "writeError" : { "code" : 10088, "errmsg" : "insertDocument :: caused by :: 10088 cannot index parallel arrays [a] [a]" } })
2.6.2-pre w/ SERVER-8192 patch:
> var myDB = db.getSiblingDB('btree'); > myDB.dropDatabase(); { "dropped" : "btree", "ok" : 1 } > myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1}); { "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 } > myDB.foo.insert({a: {a: [1]}, b: {a: [1]}}); WriteResult({ "nInserted" : 1 })
master:
> var myDB = db.getSiblingDB('btree'); > myDB.dropDatabase(); { "dropped" : "btree", "ok" : 1 } > myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1}); { "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 } > myDB.foo.insert({a: {a: [1]}, b: {a: [1]}}); WriteResult({ "nInserted" : 1 })
Version: 9c3edc610c7f52a3d502fbc50e0acc55b5efa645
- is related to
-
SERVER-8192 Optimize btree key generation
- Closed