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 Guest
Created on Mar 15, 2022

enable $and operator for multiple words in a search term (not only $or)

It seems a commonly needed ability to decrease the amount of results from a multi-word search query instead of expanding it, since the default operator for every word is $or. If there could be a built-in $and option it will be great. Thank you.
  • Guest
    Mar 15, 2022
    You can get and- + or-type operators in two ways. The clunky way is to use query string. The more scalable and maintainable approach is to use compound. should is or. must is and. mustNot is and not. Compound: https://docs.atlas.mongodb.com/atlas-search/compound/ Query String: https://docs.atlas.mongodb.com/atlas-search/queryString/ Query String is easier for people to wrap their heads around earlier, but it is far more limited and less flexible than compound.