title: How to prevent _t and _v when inserting into MongoDB?
body: <p>I'm utilizing Dictionary. After <strong>.insert()</strong> there are "_t" and "_v". Two posts here talked about <a href="https://stackoverflow.com/questions/24199862/how-do-i-prevent-t-field-from-appearing-when-upserting-into-mongodb">serialization</a> converting to <a href="https://stackoverflow.com/questions/19786403/dictionarystring-object-to-bsondocument-conversion-omitting-t-field">JSON first then BSON</a>. I'm using MongoDB's driver v2.4.3, </p>
  
  <pre><code>mCollection.InsertOne(x);
  IMongoCollection&lt;myDoc&gt; mCollection = Db.GetCollection&lt;myDoc&gt;("whatever");
  </code></pre>
  
  <p>If I do JSON-to-BSON, it complains about can't convert BsonDocument to myDoc. Switching to <code>IMongoCollection&lt;BsonDocument&gt; mCollection = Db.GetCollection&lt;BsonDocument&gt;("whatever");</code> still get _t and _v.</p>
  
  <p>How to avoid _t and _v?</p>
  
  <p><a href="https://i.stack.imgur.com/zwom7.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/zwom7.jpg" alt="enter image description here"></a></p>
  
  <p>Here is my code of data type and utilization:</p>
  
  <pre><code>public class myObjForDictionary
      {
          //...
      }
      public class myDoc
      {
          // ... some other elements, then Dictionary
          public Dictionary&lt;string, object&gt; myDictionary { get; set; }
      }
  
      // to instantiate the
      class myClass
      {
          // define MongoDB connection, etc. 
          // instantiate myDoc and populate data
          var x = new myDoc
          {
              //...
              myDictionary = new Dictionary&lt;string, object&gt;
              {
                  { "type", "something" },
                  { "Vendor", new object[0] },
                  { "obj1", //data for myObjForDictionary
                  }
              };
          }
  
      }
  </code></pre>