title: I am getting an error which says "OperationFailure: $sample stage could not find a non-duplicate document after 100 while using a random cursor"
body: <p>I am having 173 documents and due to unknown reasons I am getting the below error. How do I fix this and what is the root cause?</p>
  
  <pre><code>OperationFailure: $sample stage could not find a non-duplicate document after 100 while using a random cursor
  </code></pre>
  
  <p>I am using the below command with pymongo and using python 2.7</p>
  
  <pre><code>    db.Airlines2.aggregate([{'$sample': {'size': 8}}])
  </code></pre>