aggregation: need an array indexing operator

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Major - P3
    • 3.1.5
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Minor Change
    • Quint Iteration 4, Quint Iteration 5
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      At present, there's no way to extract a specific element from an array-valued field. An operator should be added that could be used in a projection, e.g.:

      db.runCommand({aggregate:"c", pipeline:[
      { $project : {
      foo :

      { $at:["$arrayField", 5] }

      }}
      ]});

      The effect of this would be put add the computed field (virtual field) foo to the projection, and give it the value of arrayField[5].

            Assignee:
            Charlie Swanson
            Reporter:
            Daniel Pasette (Inactive)
            Votes:
            75 Vote for this issue
            Watchers:
            46 Start watching this issue

              Created:
              Updated:
              Resolved: