Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumMongoDBtext and $regex searchSingle-choice MCQ

You have a text index on `title` and `body`. A user searches for the phrase "machine learning" but also wants to exclude documents containing the word "beginner". Which `$text` query is correct?

db.articles.find({ $text: { $search: "..." } })