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

wildcardProjection not available for subtrees

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 4.2.1
    • Index Maintenance
    • Query Optimization
    • ALL

    Description

      wildcardProjection does not work for wildcard indexes on a subtree. For example:

      db.getCollection("companies").createIndex( { "representatives.$**" : 1 }, {wildcardProjection: {"representatives.niceNames": 0}} );

       Gives the error:

      {
       "ok" : 0.0,
       "errmsg" : "The field 'wildcardProjection' is only allowed when 'key' is {\"$**\": ±1}",
       "code" : 9,
       "codeName" : "FailedToParse"
      }

      Since the doc does not mention any such restriction, I am assuming it's a bug.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            eliott.coyac@gmail.com Eliott Coyac
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: