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 Atlas Search
Created by Jonathan Ostrander
Created on Apr 10, 2026

Atlas $search facets against embedded documents have no ability to count/bucket at the parent document

What problem are you trying to solve?

Focus on the what and why of the need you have, not the how you'd like it solved.

The $search.returnScope query option supports fetching matching embeddedDocuments, and additionally performs sorting, facets and counting at the embedded document level.

I need to be able to retrieve facets based on matching embeddedDocuments, where embedded documents belonging to the same parent documents contribute at most once to each bucket.

What would you like to see happen?

Describe the desired outcome or enhancement.

e.g. for documents:
{
personId: X,
branches: [
{ branchCRD: 123 },
{ branchCRD: 123 },
{ branchCRD: 000 }
]
},
{
personId: Y,
branches: [
{ branchCRD: 123 },
{ branchCRD: 456 },
]
},
{
personId: Y,
branches: [
{ branchCRD: 000 },
]
}


the filter "branches.branchCRD = 123 OR 456", the output should be
- 123: 2
- 456: 1

Why is this important to you or your team?

Explain how the request adds value or solves a business need.

This request solves a problem for our company by allowing firms to see individuals represented in the data being grouped at the parent level to ensure the counts is not misleading to our users.

What steps, if any, are you taking today to manage this problem?

We are working closely with MongoDB partners to explore feature support before these reports are able to go live.