[SERVER-74496] Further extend wildcardProjection to support compound wildcard indexes Created: 01/Mar/23  Updated: 29/Oct/23  Resolved: 14/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Ruoxin Xu Assignee: Alexander Ignatyev
Resolution: Fixed Votes: 0
Labels: M4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2023-03-20
Participants:

 Description   

Currently we use a separate validation logic for compound wilcard indexes. There are some inconsistencies with the validation for single-field wildcard indexes.

------

We should support index spec like this:

db.test.createIndex({"$**": 1, d: 1}, {'wildcardProjection': {a: {b: 1, c: 1}});

This validation asserts that all top-level fields should be of a numeric type.

 


Another pattern we would want to support is:

 

db.test.createIndex({"$**": 1, other: 1}, {'wildcardProjection': {_id: 0, a: 1}})

 

Currently we hit this assertion This wildcardProjection is equivalent to {a: 1}, which should be a valid one. All we want to make sure is that there's no overlaps between the wildcard component and other regular fields. 



 Comments   
Comment by Githook User [ 14/Mar/23 ]

Author:

{'name': 'Alexander Ignatyev', 'email': 'alexander.ignatyev@mongodb.com', 'username': 'aligusnet'}

Message: SERVER-74496 Suppoprt nested documents in Wildcard Projections and fix _id processing
Branch: master
https://github.com/mongodb/mongo/commit/9fc98cca286730529bb7f0c223569c3175b85a88

Generated at Thu Feb 08 06:27:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.