title: MongoDB Bson unique mapper serializer
body: <p>im working with mongodb3.6 and .NetCore2.0, following the <strong><a href="http://mongodb.github.io/mongo-csharp-driver/2.5/reference/bson/mapping/" rel="nofollow noreferrer">mongo-csharp-driver2.5</a> documentation</strong>. </p>
  
  <p>i want to add a Bson unique map serializer for some fields. like in here:  </p>
  
  <pre><code>public class UserAccount : Person
  {
      [Required]
      [**i want this to be unique also, like i set it required**] 
      public string Username { get; set; }
      public string UserCode { get; set; }
  }
  </code></pre>
  
  <p>i searched for it in documentation, also google it, but didn't find any help in C# (regarding the mapping clause). </p>