title: List of strings into Bson Array
body: <p>I am using MongoDb 2.4.9 version. when i try to convert list of strings in to Bson Array i end up in below error:</p>
  
  <pre><code>BsonArray bArray = new BsonArray();
  foreach (var term in termMonitorIds)
  {
      bArray.Add(term.ToBson());
  }
  </code></pre>
  
  <blockquote>
    <p>Server Error in '/' Application.</p>
    
    <p>A String value cannot be written to the root level of a BSON document.</p>
    
    <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.InvalidOperationException: A String value cannot be written to the root level of a BSON document.</p>
  </blockquote>
  
  <p><strong>EDIT</strong></p>
  
  <p>When i use that in the LINQ Query below:</p>
  
  <pre><code>entities =
                      (from e in this.collection.AsQueryable&lt;SocialRecord&gt;()
                       where sources.Contains(e.SocialType) &amp;&amp; (e.DateCreated &gt;= fr) &amp;&amp; (e.DateCreated &lt;= to) &amp;&amp; e.TermMonitorIds.Any(X=&gt; bArray.Contains(X)) &amp;&amp; e.IsExactMatch == isInstagramExactMatch
                       select e)
                      .Take(5000)
                      .ToList();
  </code></pre>
  
  <p>results in Value cannot be null. Parameter name: name . This error message only happens when i added bArray to the Query.</p>