title: How to pull object from array with array of matching key-value pair
body: <p>i have the below array structure in MongoDB</p>
  
  <pre><code>{
    "_id": "5dff75968102f11e20ae888e",
    "docID": "Employees",
    "data": [
      {
        "Employee No": "234768241",
        "Employee Name": "Gretchen Goodpaster"
      },
      {
        "Employee No": "234768242",
        "Employee Name": "Bettie Brett"
      },
      {
        "Employee No": "234768243",
        "Employee Name": "Joette Dorazio"
      },
      {
        "Employee No": "234768244",
        "Employee Name": "Freeman Edison"
      }
    ]
  }
  </code></pre>
  
  <p>I would want pass the array of Employee No's as below and pull the objects with matching Employee No's.</p>
  
  <pre><code>let data = [{Employee No": "234768241"}, {"Employee No": "234768242"}]
  </code></pre>
  
  <p>What i have tried so far</p>
  
  <pre><code>collection.updateOne(
      { docID: "Employees" },
      {
          $pull: {
              "data": { $in: data }
          }
      }
  );
  </code></pre>
  
  <p>But this doesn't remove the object from the array, but if i pass the object array with both Employee No &amp; Employee Name then it is getting deleted. I'm looking for the solution where only one Employee No array can be used to pull the objects.</p>