[SERVER-67153] Clarify behavior of array traversal in agg expression Created: 09/Jun/22  Updated: 06/Dec/22

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

Type: Improvement Priority: Major - P3
Reporter: Svilen Mihaylov (Inactive) Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

Consider the following document:

{b: {[{c: 2}, {c: 3}]}}

If it is referred from an agg expression such as [\{$project: {a: "$b.c"}}]

then the result (assigned at field "a") will be (unsurprisingly) [2, 3].

Now consider this document which adds extra array nesting:

{b: {[[{c: 2}, {c: 3}]]}}

Currently in classic, the expression returns an empty array [], instead of the more arguably rational result of [[2, 3]]

This bug is about clarifying this behavior and specifically determining if it makes sense to adopt it going forward, particularly in the context of the new optimizer.


Generated at Thu Feb 08 06:07:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.