title: mongodb find by multiple array items
body: <p>If I have a record like this;</p>
  
  <pre><code>{
    "text": "text goes here",
    "words": ["text", "goes", "here"]
  }
  </code></pre>
  
  <p>How can I match multiple words from it in MongoDB? When matching a single word I can do this;</p>
  
  <pre><code>db.find({ words: "text" })
  </code></pre>
  
  <p>But when I try this for multiple words, it doesn't work;</p>
  
  <pre><code>db.find({ words: ["text", "here"] })
  </code></pre>
  
  <p>I'm guessing that by using an array, it tries to match the entire array against the one in the record, rather than matching the individual contents.</p>