[SERVER-31991] Allow n-ary aggregation expressions to compute their array of arguments dynamically Created: 15/Nov/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Joel Goldfinger Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-27964 $zip should accept array of arrays ex... Closed
is duplicated by SERVER-40494 Aggregation Framework does not have r... Closed
Related
related to SERVER-31786 $concatArrays not working on existing... Closed
related to SERVER-31831 Improve aggregation set operations fo... Backlog
is related to SERVER-10681 $multiply operator cannot processed a... Closed
is related to SERVER-16281 $setUnion does not descend into neste... Closed
is related to SERVER-10626 Support numeric arrays as input to $a... Closed
is related to SERVER-42020 Add SumOfProduct and ProductOfSum acc... Closed
is related to SERVER-30547 $dateFromParts should accept an objec... Open
is related to SERVER-10676 $multiply does not support a referenc... Closed
is related to SERVER-27964 $zip should accept array of arrays ex... Closed
Assigned Teams:
Query Optimization
Sprint: Query 2019-06-17
Participants:

 Description   

For example, a user might store the arguments to an n-ary expression like $concatArrays inside a document in the collection:

db.c.insert({arraysToConcat: [[1, 2, 3], [4, 5, 6]]});

There should be a way to use the the value of the field path expression "$arraysToConcat" as the list of arguments to $concatArrays. Neither the expressions {$concatArrays: "$arraysToConcat"} nor {$concatArrays: ["$arraysToConcat"]} have this meaning. SERVER-31786 has a more detailed discussion of the use case.

Original description

The $concatArrays operator does not handle using a multi array field already in the collection.

The current work around is to use $reduce with $concatArrays.

See SERVER-31786 for more details.



 Comments   
Comment by Asya Kamsky [ 30/May/19 ]

Linking to a number of related tickets, all basically expecting to be able to use a stored array where aggregation is expecting an array of specified input values.

Comment by Mark Agarunov [ 15/Nov/17 ]

Hello devnopt,

Thank you for the report. I've set the fixVersion to "Needs Triage" for this new feature to be scheduled against our currently planned work. Updates will be posted on this ticket as they happen.

Thanks,
Mark

Generated at Thu Feb 08 04:28:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.