[SERVER-32733] Support same index definition but with different partial filter expressions Created: 17/Jan/18 Updated: 06/Dec/22 Resolved: 01/Nov/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Luis Torres Aguiar da Costa | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
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.
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. |
| Comments |
| Comment by Asya Kamsky [ 01/Nov/19 ] |
|
Didn't realize we already had one for this request, marking this one a duplicate. |
| Comment by Asya Kamsky [ 01/Nov/19 ] |
|
Re-opening to consider as an enhancement request to allow "same" index keys but different partial filter expression (and different name, obviously). |
| Comment by aleksandar milovanovic [ 15/Jul/19 ] |
|
You should reconsider as this is a genuine usage problem. My usecase: I have a big log collection and I want to expire different types of documents after different amount of time. I need to index by time, to do a partialFilterExpression on the type of document and to choose expireAfterSeconds. Current behavior is very limiting.... |
| Comment by Mark Agarunov [ 18/Jan/18 ] |
|
Hello LuisTAC, Thank you for the report. Unfortunately, multiple indexes with the same keys that differ only by options are not supported by MongoDB so it would not be possible to create the two indexes as you described. Thanks, |