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

get value from document using expression

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None

      Description

      can we hav an aggregation operator like "$arrayElemAt" 
      but instead of working on array the input is a document

      { $elemAt: [ <document>, <key> ] }

      The <document> expression can be any valid expression as long as it resolves to a document.

      The <key> expression can be any valid expression as long as it resolves to a String.

       

      Behavio

      Example     ->     Results

      { $elemAt: [ \{k1:"v1",k2:"v2"}

      , "k1" ] }   -> "v1"

      { $elemAt: [ \{k1:"v1",k2:"v2"}

      , "k3" ] }   -> null 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nick.brewer Nick Brewer
              Reporter:
              yassineKarim yassine Karim
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: