get value from document using expression

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 

              Assignee:
              Nick Brewer (Inactive)
              Reporter:
              yassine Karim [X]
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: