MongoDB.Driver.TestCollectionSafeMode.InitCollection C# (CSharp) Метод

InitCollection() защищенный Метод

protected InitCollection ( string name ) : IMongoCollection
name string
Результат IMongoCollection
        protected IMongoCollection InitCollection(string name)
        {
            IMongoCollection col = DB[name];
            col.MetaData.CreateIndex(new Document(){{"x", IndexOrder.Ascending}}, true);
            for(int x = 0; x < 5; x++){
                col.Insert(new Document(){{"x", x}, {"y", 1}});
            }
            return col;
        }