public void TestCreateIndexNoNames() { CollectionMetadata cmd = DB["indextests"].Metadata; cmd.CreateIndex(new Document().Add("lname", IndexOrder.Ascending).Add("fname", IndexOrder.Ascending), true); Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes["_lname_fname_unique_"]); }
public void TestCreateIndex() { CollectionMetadata cmd = DB["indextests"].Metadata; cmd.CreateIndex("lastnames", new Document().Add("lname", IndexOrder.Ascending), false); Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes["lastnames"]); }
public void TestDropIndex() { CollectionMetadata cmd = DB["indextests"].Metadata; cmd.CreateIndex("firstnames", new Document().Add("fname", IndexOrder.Ascending), false); Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes["firstnames"]); cmd.DropIndex("firstnames"); Assert.IsFalse(cmd.Indexes.ContainsKey("firstnames")); }