title: Aggregation with $limit , $match , $ne returns more documents than expected
body: <p>I have two collection vmdetails and rsc_installtion_status , i want to select the documents from rsc_installtion_status which do not have matching hostname in vmdetails </p>
  
  <p>I used the below query </p>
  
  <pre><code> db.rsc_installtion_status.aggregate([{$lookup:{ from: "vmdetails",let: {rschostname: "$hostname"},pipeline:[{$match:{$expr:{$ne :["$hostname","$$rschostname"]}}}],as: "rscInstall"}},{$unwind:"$rscInstall"},{$project:{"_id":0,"rscInstall":0}}])
  </code></pre>
  
  <p>the no of records in vmdetails</p>
  
  <pre><code>&gt; db.vmdetails.find().count()
  4
  </code></pre>
  
  <p>the no of records in </p>
  
  <pre><code>&gt; db.rsc_installtion_status.find().count()
  37
  </code></pre>
  
  <p>out of 37 three documents match with documents in vmdetails so i expect the result to be 34 documents but the outcome what i get is 3 records for each document ie 34X3 </p>
  
  <pre><code>{ "hostname" : "string", "configdownload" : "string", "rscpkgdownload" : "string", "configextraction" : "string", "rscpkgextraction" : "string", "rscstartup" : "string", "installedversion" : "string", "_class" : "com.mastercard.rsc.domain.RscInstalltionStatus" }
  { "hostname" : "string", "configdownload" : "string", "rscpkgdownload" : "string", "configextraction" : "string", "rscpkgextraction" : "string", "rscstartup" : "string", "installedversion" : "string", "_class" : "com.mastercard.rsc.domain.RscInstalltionStatus" }
  { "hostname" : "string", "configdownload" : "string", "rscpkgdownload" : "string", "configextraction" : "string", "rscpkgextraction" : "string", "rscstartup" : "string", "installedversion" : "string", "_class" : "com.mastercard.rsc.domain.RscInstalltionStatus" }
  </code></pre>
  
  <p>but in the $match if i use $eq instead of $ne the results are correct it only outputs three records. how can i select the records which do not match with hostname</p>