[SERVER-42835] Inconsistent handling of arrays as $group keys Created: 15/Aug/19  Updated: 29/Oct/23  Resolved: 30/Sep/19

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

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Ted Tuckman
Resolution: Fixed Votes: 0
Labels: query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Operating System: ALL
Sprint: Query 2019-09-23, Query 2019-10-07
Participants:

 Description   

> db.foo.find()
{ "_id" : 2 }
{ "_id" : 1, "x" : null }
{ "_id" : 3, "y" : null }
{ "_id" : 4, "x" : null, "y" : null }
> db.foo.aggregate([{$group: {_id: ["$x", "$y"]}}])
{ "_id" : [ "$x", "$y" ] }
> db.foo.aggregate([{$group: {_id: {z: ["$x", "$y"]}}}])
{ "_id" : { "z" : [ null, null ] } }

I would contend that the middle one should result in

{_id: [null, null]}

Looks like this is the offending line.



 Comments   
Comment by Githook User [ 30/Sep/19 ]

Author:

{'name': 'Ted Tuckman', 'username': 'TedTuckman', 'email': 'ted.tuckman@mongodb.com'}

Message: SERVER-42835 Fix inconsistent handling of arrays as $group keys
Branch: master
https://github.com/mongodb/mongo/commit/8e981e8315ab7c7bae93da623e40ffdce5b4ec6e

Generated at Thu Feb 08 05:01:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.