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

Support $elemMatch projection on nested documents

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.1, 2.5.3
    • Component/s: Querying
    • Labels:
    • Query Execution

      It will be nice to have support $elemMatch projection on nested documents.
      For example when schama look like this to support multilingual:

      {
        "name": [
          {
            "locale": "en",
            "value": "milk"
          },
          {
            "locale": "de",
            "value": "milch"
          }
        ],
        "brand": {
          "attribute": "value1",
          "name": [
            {
              "locale": "en",
              "value": "MilkBrand"
            },
            {
              "locale": "de",
              "value": "MilchMarke"
            }
          ]
        }
      }
      
      

      this query is unsupported

      db.test.find({},{name:{$elemMatch:{locale:"en"}},"brand.name":{$elemMatch:{locale:"en"}}})
      

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            noter Patryk Wasik
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: