title: MongoDB Performance With $nin query
body: <p>I have a collection of 1000000 documents. I want to fetch those documents whose uid not in the given uids.so I am using mongo find query along with $nin so the query looks like:</p>
  
  <blockquote>
    <p>{uid:{$nin:[1,2,3......500000}}</p>
  </blockquote>
  
  <p>but suppose in future my documents count increase and I am passing more uid with $nin query. </p>
  
  <p>Doses Mongo with $nin query affects query performance? Is any other option to achieve this without using $nin query?</p>