Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on Jun 27, 2023

Flatten arrays in group stage

Have group operators to flatten document arrays into a single one with or without repeated elements. So -> doc1 = {arr: [1,2,3,4], gr: "group"}, doc2 = {arr: [5, 6, 7, 8], gr: "group"} {$group: {_id: "$gr", arrays: {$***: "$arr"} } } => {_id: "gr", arrays: [1, 2, 3, 4, 5, 6, 7, 8]}
  • Attach files
  • Guest
    Oct 25, 2023
    This request is also tracked here https://jira.mongodb.org/browse/SERVER-16284