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);
        }

posted @ 2012-08-04 15:41  Kyw08  阅读(408)  评论(0编辑  收藏  举报