-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query
-
ALL
Currently, it's impossible to create an Index with the same definition (same keys) but a different partial than one that already exists in the collection.
Trying to do it, produces the following error:
The full response is
{ "ok" : 0.0, "errmsg" : "Index: { v: 2, key: { prop: 1, timestamp: -1 }, name: \"name1.prop\", ns: \"db1.col1\", partialFilterExpression: { name: \"name1\" } } already exists with different options: { v: 2, key: { prop: 1, timestamp: -1 }, name: \"name2.prop\", ns: \"db1.col1\", partialFilterExpression: { name: \"name2\" } }", "code" : 85, "codeName" : "IndexOptionsConflict" }
My indexes are "dynamic", i.e. they will be added to the collection as Documents are added to another collection. Being so, I need to later add these indexes, but this bug won't allow me so.
Now, the only option is to make the index not partial, but I don't really like that, since it would probably use some unnecessary space.
- duplicates
-
SERVER-25023 no way to index the same fields with two different partial index filters
- Closed