title: C# mongoDB Driver concurrent Insert fails
body: <p>I have am trying to write records to mongodb using the C# mongo driver 2.13.2. I am calling the <code>Insert</code> method below in a loop from another class. In that class if I sleep for 5 seconds between each call to the Insert method, then all calls result in an insert. If I remove the sleep then some records get dropped. Here is the relevant code taking out the unnecessary bits.</p>
  <p><code>_collections</code> is a dictionary object that stores initialized collections.</p>
  <pre><code>private readonly IDictionary&lt;string, IMongoCollection&lt;BsonDocument&gt;&gt; _collections;
  </code></pre>
  <p>This section is in the constructor of my class which is initialized at application startup. <code>db.Collections</code> contains a list of collection names and a way to retrieve them when required by the key. I am using the key and value from <code>db.Collections</code> to create a dictionary of initialized collections in the <code>_collections</code> variable.</p>
  <pre><code>var database = client.GetDatabase(db.Database);
  foreach (var c in db.Collections)
  {
     _collections.Add(c.Key, database.GetCollection&lt;BsonDocument&gt;(c.Value));
  }
  </code></pre>
  <p>The section below is a method in the same class, where I operate on a collection by passing in the collection key and calling the insert method</p>
  <pre><code>public async Task&lt;bool&gt; Insert(BsonDocument data, string collection)
  {
  
      if (data == null)
      {
          return false;
      }
      
      
      await _collections[collection].InsertOneAsync(data);
  
  
      return true;
  
  }
  </code></pre>
  <p>Why are records failing to insert when there is no sleep? When I provide a sleep of more than 5 seconds then all iterations result in an insert.</p>