MongoUtility.Command.Operater.DropMongoIndex C# (CSharp) Method

DropMongoIndex() public static method

删除索引[KEY_ID]以外
public static DropMongoIndex ( string indexName, MongoCollection mongoCol ) : bool
indexName string
mongoCol MongoCollection
return bool
        public static bool DropMongoIndex(string indexName, MongoCollection mongoCol)
        {
            if (indexName == ConstMgr.KeyId)
            {
                return false;
            }
            if (mongoCol.IndexExistsByName(indexName))
            {
                mongoCol.DropIndexByName(indexName);
            }
            return true;
        }