mongo 脚本对应的C#实现方式(待整理)

1,createCollection

脚本:db.createCollection("Sp_HtmlContent080415", {capped:true, size:20000000000})

C#:

public void CreateColllection(string collectionName)
        {
         var options = CollectionOptions
          .SetCapped(true)
          .SetMaxSize(AppConfig.ConfigInfo.Sp_HtmlContentCollectionFixSize);
            MongoHelper.GetMongo_DB2().CreateCollection(collectionName, options);
        }

原文地址:https://www.cnblogs.com/zsuxiong/p/2622964.html