Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumMongoDBmultikey array indexesSingle-choice MCQ

A collection has a multikey index on 'tags'. Given this query, will it use the index efficiently to match documents where the tags array contains BOTH values?

db.docs.find({ tags: { $all: ["red", "sale"] } }) // index: { tags: 1 }