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
Created by Guest
Created on Dec 9, 2022

Add hint support for MongoDB API functions

The "hint" option for Mongo Shell query/write operations is very useful when the Query Planner does not select the right index by default, or just to make sure the right index is used. When you cannot use the "Hide index" feature on the index selected by default, "hint" becomes the only way to have an efficient IXSCAN. However, the "hint" feature does not exist on the MongoDB API functions (https://www.mongodb.com/docs/atlas/app-services/functions/mongodb/api/). This means that no command we can run inside a Trigger can specify a "hint" option. I think that "hint" is a great "backup" feature for cases where the Query Planner selects the wrong index and you cannot afford to hide that index for some reason.