MongoDB Text Search AND multiple search words

Give a try to:

db.supplies.runCommand("text", {search:"\"printer\" \"ink\""})

Also, here’s a quote from docs:

If the search string includes phrases, the search performs an AND with
any other terms in the search string; e.g. search for “\”twinkle
twinkle\” little star” searches for “twinkle twinkle” and (“little” or
“star”).

Hope that helps.

Leave a Comment