title: MongoDB findAndModify from multiple clients
body: <p>my MongoDB collection is used as a job queue, and there are 3 C++ machines that read from this collection. The problem is that those three can't perform the same job. All jobs need to be made only once.</p>
  
  <p>I fetch all un-done jobs by searching the collection for all records with 'isDone:False' and then update this document, 'isDone:True'. But if 2 machines find the same document at the same time, they would to the same job both. How can I avoid this?</p>
  
  <p>Edit: My question is - do findAndModify really solves that problem?
  (After reading <a href="https://stackoverflow.com/questions/15505176/a-way-to-ensure-exclusive-reads-in-mongodbs-findandmodify">A way to ensure exclusive reads in MongoDb&#39;s findAndModify?</a>)</p>