Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
ALL
-
Description
If you have two index specs that are the same except for the presence of a 'background' field, ensureIndexes will no longer treat them as identical specs. This bug is a result of the changes from SERVER-10879.
Error with master:
> var coll = db.newColl;
|
> coll.drop();
|
true
|
>
|
> coll.ensureIndex({foo: 1}, {background: false});
|
WriteResult({ "nInserted" : 1 })
|
> coll.ensureIndex({foo: 1});
|
WriteResult({
|
"nInserted" : 0,
|
"writeError" : {
|
"code" : 67,
|
"errmsg" : "Index with name: foo_1 already exists with different options"
|
}
|
})
|
No error with 2.4.9:
> var coll = db.newColl;
|
> coll.drop();
|
true
|
>
|
> coll.ensureIndex({foo: 1}, {background: false});
|
> coll.ensureIndex({foo: 1});
|
>
|
|
Version: 914a26f51ff7ffeb28922273925318da6a6eba71
Attachments
Issue Links
- is related to
-
SERVER-13208 The dropDups index option should be ignored if the index already exists
-
- Closed
-
-
SERVER-10879 ensureIndex() on existing text index should not error
-
- Closed
-