title: Mongodb java api: WriteResult#getN()
body: <p>I'm writing some Java code using MongoDB with Java API and I'm unsure of some part of the Javadoc.</p>
  
  <p>In a multi-thread context I use <a href="http://api.mongodb.org/java/2.6/com/mongodb/DBCollection.html#update%28com.mongodb.DBObject,%20com.mongodb.DBObject%29">DBCollection.html#update(com.mongodb.DBObject, com.mongodb.DBObject)</a> to update a <strong>unique</strong> document, but I saw that two threads could try to write concurrently. In this context, I observed that only one write was done, as Mongodb seems to use optimistic write lock, but I wanted to find out programmatically in which thread the write was the one who wrote, and which one was not. As a "no update" behavior was silent (I mean no exception or something), I searched into the API some way to answer my issue and after some tests found out this method: <a href="http://api.mongodb.org/java/2.6/com/mongodb/WriteResult.html#getN%28%29">WriteResult#getN()</a></p>
  
  <pre><code>public int getN()
      Gets the "n" field
      Returns:
  </code></pre>
  
  <p>The description is, hum... not really exhaustive. My tests showed that the thread that win the write has a getN() that return 1, and the other 0.</p>
  
  <p>So my question is: Could someone confirm this ?</p>