title: MongoDB/mongoose queries and the $in operator
body: <p>A question about MongoDB/mongoose queries using $in <a href="http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24in" rel="nofollow">http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24in</a></p>
  
  <p>If I do a query where both the target field AND the $in field have multiple values, is there a way to know which target/$in field elements were matched in a returned argument?</p>
  
  <p>Eg if I have a bunch of documents like this </p>
  
  <pre><code>doc1 = { name : Abe, children : [Betty, Claire, Donald, Eamon] }
  </code></pre>
  
  <p>and i set up a query </p>
  
  <pre><code>Model.find( { children : { $in : [Ann, Betty, Clive] } })
  </code></pre>
  
  <p>if i get the result doc1 above, is there any way i can know (without iterating through the arrays manually) which target element and which $in element were matched? 
  so in the case above, how could I access the fact that doc1 was chosen because it matched 'Betty'?
  Thanks in advance!</p>