[SERVER-47659] Add 'wildcardProjection' parameter to index signature Created: 20/Apr/20  Updated: 29/Oct/23  Resolved: 19/Apr/21

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Bernard Gorman Assignee: Yoon Soo Kim
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-14369 Investigate changes in SERVER-47659: ... Closed
Related
related to SERVER-62636 setFeatureCompatibilityVersion 4.4 su... Closed
related to SERVER-67446 Ensure consistent wildcardProjection ... Closed
is related to SERVER-25023 no way to index the same fields with ... Closed
is related to SERVER-47657 Add 'unique' and 'sparse' parameters ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-03-08, Query Execution 2021-03-22, Query Execution 2021-04-05, Query Execution 2021-04-19, Query Execution 2021-05-03
Participants:

 Description   

At present, an index's signature - that is, the combination of parameters which uniquely identify the index - is defined by its keypattern and collation. No index can be created if its signature is equivalent to an existing index. SERVER-25023 seeks to add the partialFilterExpression parameter to this list, such that multiple partial indexes could be built on the same fields so long as their filters are different.

We should also add the wildcardProjection parameter to the index signature. At present, we allow any number of wildcard indexes to be built using the {"field.path.$**": 1} notation, but we do not allow multiple wildcard indexes with different projections to exist. It is therefore legal to do this:

db.coll.createIndex({"a.$**": 1})
db.coll.createIndex({"b.$**": 1})

... but illegal to do the following, even though the indexes should be functionally identical to the above:

db.coll.createIndex({"$**": 1}, {wildcardProjection: {a: 1}})
db.coll.createIndex({"$**": 1}, {wildcardProjection: {b: 1}})

More significantly, the former syntax is limited to inclusion of a single path; permitting the latter would be far more powerful in allowing the user to create separate wildcard indexes to index different sections of their dataset.



 Comments   
Comment by Githook User [ 19/Apr/21 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-47659 Added 'wildcardProjection' index option to index signature
Branch: master
https://github.com/mongodb/mongo/commit/8c0dc70a2dfdfb52991ec7206e0007b6c6563d7b

Generated at Thu Feb 08 05:14:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.