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

Allow sub-field matching in Wildcard indexes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 4.2.7
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:

      Description

      Allow for the simple creation of a wildcard index that indexes specific patterns below the wildcard:

       

      db.collection.createIndex(
        { "FieldHolder.$**.SearchSort": 1 }
      )
      

       

       

      To capture only the SearchSort fields in an example like this:

       

       

      {
          FieldHolder: {
              Field1: {
                  Meta: { Some: "Metadata we dont want to index" },
                  More: { Metadata: "we don't want to index"},
                  Value: "Some Value",
                  SearchSort: "some value"
              },
              Field2: {
                  Meta: { Some: "Metadata we dont want to index" },
                  More: { Metadata: "we don't want to index"},
                  Value: 1,
                  SearchSort: "1",
              },
              Field3....
          }
      }
      

       

      This would also more easily allow the implementation of non-sparse indexing on wildcards, where you could forcibly assume the existence of some field (SearchSort in this case)

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-optimization Backlog - Query Optimization
              Reporter:
              chad@onspring.com Chad Kreimendahl
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: