title: Filter results using $match in MongoDB aggregate returning blank array
body: <p>I have the following schema:</p>
  <pre class="lang-js prettyprint-override"><code>const UserQualificationSchema = new Schema(
      {
          user: {
              type: mongoose.Schema.Types.ObjectId,
              ref: 'User',
          },
          qualification: {
              type: mongoose.Schema.Types.ObjectId,
              ref: 'Qualification',
          },
          expiry_date: {
              type: Date
          }
      }
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>const QualificationSchema = new Schema(
      {
          fleet: {
              type: [String], // Eg [&quot;FleetA&quot;, &quot;FleetB&quot;, &quot;FleetC&quot;]
              required: true,
          }
      }
  </code></pre>
  <p>I am searching the UserQualifications with filters in a table, to search them by fleet, qualification or expiry date.  I so far have the following aggregate:</p>
  <pre class="lang-js prettyprint-override"><code>db.UserQualifications.aggregate([{
  {
      $lookup: {
        from: 'qualifications',
        localField: 'qualification',
        foreignField: '_id',
        as: 'qualification',
      },
  },
  {
    $unwind: '$qualification',
  },
  {
    $match: {
      $and: [
        'qualification.fleet': {
           $in: [&quot;Fleet A&quot;, &quot;Fleet C&quot;],  // This works
         },
        expiry_date: {
           $lt: req.body.expiry_date,  // This works
         },
        qualification: { // Also tried 'qualification._id'
           $in: [&quot;6033e4129070031c07fbbf29&quot;] // Adding this returns blank array
        }
      ]
    },
  }
  }])
  </code></pre>
  <p>Filtering by fleet, and expiry date both work, independently and in combination, however when adding by the qualification ID, it returns blank despite the ID's being sent in being valid.</p>
  <p>Am i missing something here?</p>