Záleží na tom, zda se snažíte najít dokumenty, kde jsou words
obsahuje oba prvky (text
a here
) pomocí $all
:
db.things.find({ words: { $all: ["text", "here"] }});
nebo některý z nich (text
nebo here
) pomocí $in
:
db.things.find({ words: { $in: ["text", "here"] }});