mongodb find by multiple array items

Depends on whether you’re trying to find documents where words contains both elements (text and here) using $all:

db.things.find({ words: { $all: ["text", "here"] }});

or either of them (text or here) using $in:

db.things.find({ words: { $in: ["text", "here"] }});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)