title: How to return all docs matching value in the array of one of the field : mongodb aggration
body: <p>I have stored the collection as give below</p>
  <pre><code>  .....
     name : &quot;product name&quot;,
    &quot;productCategories&quot;: [
      &quot;5f44f61fd4051ef8fa104537&quot;,
      &quot;5f44e28dd4051ef8fa1044ef&quot;,
      &quot;5f460caf21262a1ce99934e4&quot;
    ],
  ....
  </code></pre>
  <p>I am trying to query aggregate in mongodb ( mongoose but i am not able match against value in</p>
  <blockquote>
  <p>prodcutCategories</p>
  </blockquote>
  <p>var aggregate = this.productModel.aggregate([{ $match:{  }}])</p>
  <p>I tried  all nothing working for simple solution , can any body help me</p>
  <p>update:</p>
  <p>var aggregate = this.productModel.aggregate([{$match:{productCategories :new mongoose.Types.ObjectId(args._id)}}])</p>
  <p>solved my issues ..</p>