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 Feb 28, 2025

Leveraging Group By/Distinct Query to use regular Index

When using Group By or Distinct queries on database, provide the ability to leverage existing index i.e these queries today will miss using existing index db.collection.distinct("field") db.collection.aggregate([ { $group: { _id: "$category", count: { $sum: 1 } } } ])
  • Attach files