The write-concern number is the value of “w” which maps to the number of replicas that the write must propagate to before being considered successful when w > 1.



WriteConcern control the write behavior for with various options, as well as exception raising on error conditions.


  • -1 = don’t even report network errors
  • 0 = default, don’t call getLastError by default
  • 1 = basic, call getLastError, but don’t wait for slaves
  • 2+= wait for slaves

wtimeout how long to wait for slaves before failing

  • 0 = indefinite
  • > 0 = ms to wait


fsync force fsync to disk