public void TestCreateIndexNoNames() { CollectionMetaData cmd = db["tests"]["indextests"].MetaData; cmd.CreateIndex(new Document().Append("lname", IndexOrder.Ascending).Append("fname", IndexOrder.Ascending), true); Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes["_lname_fname_unique_"]); }
public void TestCreateIndex() { CollectionMetaData cmd = db["tests"]["indextests"].MetaData; cmd.CreateIndex("lastnames", new Document().Append("lname", IndexOrder.Ascending), false); Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes["lastnames"]); }
public void TestGetOptions() { CollectionMetaData cmd = db["tests"]["reads"].MetaData; Document options = cmd.Options; Assert.IsNotNull(options); System.Console.WriteLine(options.ToString()); }
public void TestDropIndex() { CollectionMetaData cmd = db["tests"]["indextests"].MetaData; cmd.CreateIndex("firstnames", new Document().Append("fname", IndexOrder.Ascending), false); Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes["firstnames"]); cmd.DropIndex("firstnames"); Assert.IsFalse(cmd.Indexes.ContainsKey("firstnames")); }
public void TestGetIndexes() { CollectionMetaData cmd = db["tests"]["indextests"].MetaData; Dictionary <string, Document> indexes = cmd.Indexes; Assert.IsNotNull(indexes); Assert.IsTrue(indexes.Count > 0, "Should have been at least one index found."); foreach (string key in indexes.Keys) { System.Console.WriteLine(String.Format("Key: {0} Value: {1}", key, indexes[key])); } }