title: How to check if an array field contains a unique value or another array in MongoDB?
body: <p>I am using mongodb now.</p>
  <p>I have a blogpost collection, and it has a <code>tags</code> field which is an array, e.g.</p>
  <pre><code>blogpost1.tags = ['tag1', 'tag2', 'tag3', 'tag4', 'tag5']
  blogpost2.tags = ['tag2', 'tag3']
  blogpost3.tags = ['tag2', 'tag3', 'tag4', 'tag5']
  blogpost4.tags = ['tag1', 'tag4', 'tag5']
  </code></pre>
  <p>How can I do these search</p>
  <ol>
  <li>contains <code>tag1</code></li>
  <li>contains <code>['tag1','tag2']</code></li>
  <li>contains any of <code>['tag3', 'tag4']</code></li>
  </ol>