title: spring mongodb write-concern values
body: <p>I have the following core mongo options configuration in spring:</p>
  
  <pre><code>&lt;mongo:mongo host="${db.hostname}" &gt;
    &lt;mongo:options
      connections-per-host="40"
      threads-allowed-to-block-for-connection-multiplier="1500"
      connect-timeout="15000"
      auto-connect-retry="true"
      socket-timeout="60000"
      write-number="1"
      write-fsync="false"/&gt;
  &lt;/mongo:mongo&gt;
  </code></pre>
  
  <p>What I want to know is about different write-number options which is relevant to write concern like none, normal, safe etc.</p>
  
  <p>Can I assume the mapping of write-number to writeconcern as below?</p>
  
  <pre><code>NONE: -1
  NORMAL: 0
  SAFE: 1 (default)
  FSYNC_SAFE: 2
  REPLICAS_SAFE: 3
  JOURNAL_SAFE: 4
  MAJORITY: 5  
  </code></pre>
  
  <p>Following link has provided a good help to set mongo options in spring, but not specific enough for write-number values:
  <a href="https://stackoverflow.com/questions/6520439/how-to-configure-mongodb-java-driver-mongooptions-for-production-use">How to configure MongoDB Java driver MongoOptions for production use?</a> </p>