title: Understanding WriteConcern in MongoDB C#
body: <p>I have been reading up on <a href="http://docs.mongodb.org/manual/core/write-concern/" rel="noreferrer">Write Concern</a> in MongoDB. I understand that there are several levels that determine the level of guarantee that a write operation succeeded, with a performance trade-off for the higher you set this level. However, I am working in a C# environment, and I am trying to figure out how to use Write Concern there and what levels work best for certain situations. I already figured out how to collect the result of the check with a WriteConcernResult object, I am mainly interested in the levels themselves.</p>
  <p>These are my questions:</p>
  <p><strong>How do I set the Write Concern level in C# for specific writes?</strong></p>
  <p><a href="https://stackoverflow.com/questions/17261589/c-sharp-mongodb-driver-write-concern">This answer</a> suggests using the connection string, but this looks like a global setting, which I don't want, since some of the write operations I will be using are more &quot;important&quot; than others and I don't want to kill the performance. I noticed there's a <a href="https://api.mongodb.org/csharp/current/" rel="noreferrer">WriteConcern class</a> but the documentation isn't very detailed about its use (it's under MongoDB.Driver Namespace in the documentation).</p>
  <p>In particular, how do I set it to &quot;Journaled&quot; or &quot;Replica Acknowledged&quot;, seeing as it's &quot;Acknowledged&quot; by default?</p>
  <p><strong>What types of issues could get past the Write Concern check for each level?</strong></p>
  <p>For example: system crashes, power failures, network connection issues, etc. I am especially interested in something sneaking by that is <strong>not easily detected</strong>, as power failures and the like are very noticeable and we could estimate the time interval where operations may have failed and react accordingly.</p>