Beispiel #1
0
 public static void DropIndex <T>(string connectionName, string database, string collection, MongoIndexKeysWarpper <T> indexkeys) where T : new()
 {
     DropIndex(connectionName, database, collection, indexkeys);
 }
Beispiel #2
0
 public static void EnsureIndex <T>(string connectionName, string database, string collection, MongoIndexKeysWarpper <T> indexkeys, bool unique = false) where T : new()
 {
     EnsureIndex(connectionName, database, collection, indexkeys, unique);
 }
Beispiel #3
0
        public static void DropIndex(string connectionName, string database, string collection, MongoIndexKeysWarpper indexkeys)
        {
            var mongocollection = GetCollecion(connectionName, database, collection);

            mongocollection.DropIndex(indexkeys.MongoIndexKeys);
        }
Beispiel #4
0
        public static void EnsureIndex(string connectionName, string database, string collection, MongoIndexKeysWarpper indexkeys, bool unique = false)
        {
            var mongocollection = GetCollecion(connectionName, database, collection);

            if (unique)
            {
                mongocollection.CreateIndex(indexkeys.MongoIndexKeys, IndexOptions.SetUnique(true));
            }
            else
            {
                mongocollection.CreateIndex(indexkeys.MongoIndexKeys);
            }
        }