Further extend wildcardProjection to support compound wildcard indexes

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • Fully Compatible
    • QO 2023-03-20
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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. 

            Assignee:
            Alexander Ignatyev
            Reporter:
            Ruoxin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: