title: MongoDB C# driver: Class model for variable schema?
body: <p>I've got a mongo database filled with a load of GeoJSON. Some documents look like this:</p>
  
  <pre><code>{
      "_id" : ObjectId("5d652136f39c50fbe859018e"),
      "properties" : {
          "theme" : "Administrative Boundaries"
  }}
  </code></pre>
  
  <p>And others look like this:</p>
  
  <pre><code>{
      "_id" : ObjectId("5d652131f39c50fbe858f017"),
      "properties" : {
          "theme" : [ 
              "Land"
          ]
  }}
  </code></pre>
  
  <p>I.e. in some documents theme is a single string, in others it's an array.</p>
  
  <p>I was hoping the following property in my class would automatically handle both:</p>
  
  <pre><code>public string[] Theme { get; set; }
  </code></pre>
  
  <p>However mongo errors when it encounters the first JSON example.</p>
  
  <p>How should I design my class model to handle this? Currently I'm planning to use a raw BsonElement like this:</p>
  
  <pre><code>public BsonValue Theme { get; set; }
  </code></pre>
  
  <p>And then write another property to parse it. I want to be able to query this property as well using the LINQ provider.</p>