title: Batch Save to MongoDB C# Driver
body: <p>I am having difficulty batch saving MongoDB documents using the C# driver. Here's sample code that inserts a Document with a GUID BsonID. Saving one at a time works. If I insert the documents into a list and use the save command it fails with an <em>"Save can only be used with documents that have an Id."</em> error. Any thoughts?</p>
  
  <pre><code>var autolookuplist = new List&lt;BsonDocument&gt;();
              Parallel.ForEach(docs, webdoc =&gt;
                  {
                      lock (autolookuplist)
                      {
                          autoID++;
                          var hold = new APAUtoIDGuidLookup() {AutoIncrementID = autoID, ID = webdoc.ID};
                        autolookuplist.Add(hold.ToBsonDocument());
                      }
  
                    //this works
                   //   idcollection.Save(new APAUtoIDGuidLookup() { AutoIncrementID = autoID, ID = webdoc.ID });
                  });
  
  
            //this doesn't work
            idcollection.Save(autolookuplist);
  </code></pre>
  
  <p>here's the document class</p>
  
  <pre><code>public class  APAUtoIDGuidLookup
  {
      [BsonId]
      public Guid ID { get; set; }
      public int AutoIncrementID { get; set; }
  }
  </code></pre>
  
  <p>Update:
  <strong>It doesn't look like MongoDB supports batch updates.</strong> </p>