title: MongoDB Aggregation - match if value in array
body: <p>I have a collection that I'm performing an aggregation on and I've basically gotten it down to </p>
  
  <pre><code>{array:[1,2,3], value: 1},
  {array:[1,2,3], value: 4}
  </code></pre>
  
  <p>How would I perform an aggregation match to check if the value is in the array? I tried using <code>{$match: {"array: {$in: ["$value"]}}}</code> but it doesn't find anything. </p>
  
  <p>I would want the output (if using the above as an example) to be:</p>
  
  <pre><code>{array:[1,2,3], value:1}
  </code></pre>