[SERVER-23754] $unwind should error when it encounters arrays within arrays Created: 15/Apr/16  Updated: 06/Dec/22

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

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 1
Labels: query-44-grooming, storch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-26404 lookup for array inside a subdocument Closed
Related
related to SERVER-6436 Add method for unwinding nested arrays Backlog
is related to SERVER-6436 Add method for unwinding nested arrays Backlog
Assigned Teams:
Query Optimization
Backwards Compatibility: Major Change
Operating System: ALL
Participants:

 Description   

> db.foo.insert({x: [{y: [1, 2]}, {y: [3, 4]}]})
WriteResult({ "nInserted" : 1 })
> db.foo.aggregate([{$unwind: '$x.y'}])
// Produces no output.

This is not very intuitive, and there doesn't seem to be any obvious reasonable output, so we should error in this case.



 Comments   
Comment by Charlie Swanson [ 20/Mar/19 ]

Yea looks wrong to me. Want to fix it? I'm not sure if there's another DOCS ticket that's more appropriate. 

Comment by Asya Kamsky [ 20/Mar/19 ]

charlie.swanson is the docs ticket linked here wrong? it's about $lookup on array, and this ticket is about $unwind on (nested) array...

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