Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-74496

Further extend wildcardProjection to support compound wildcard indexes

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

      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@mongodb.com Alexander Ignatyev
            Reporter:
            ruoxin.xu@mongodb.com Ruoxin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: