ERR unknown command 'EVAL'

Topics: Administration, 中文(Chinese)
Jan 6, 2015 at 4:40 AM
Orchard.Redis.Extensions.RedisDatabaseExtensions

public static int KeyCount(this IDatabase database, string prefix) {
        if (database == null) {
            throw new ArgumentException("Database cannot be null", "database");
        }

        if (string.IsNullOrWhiteSpace(prefix)) {
            throw new ArgumentException("Prefix cannot be empty", "database");
        }

        var retVal = database.ScriptEvaluate("return table.getn(redis.call('keys', ARGV[1]))", values: new RedisValue[] { prefix });

        if (retVal.IsNull) {
            return 0;
        }

        return (int)retVal;
    }
var retVal = database.ScriptEvaluate("return table.getn(redis.call('keys', ARGV[1]))", values: new RedisValue[] { prefix });
Jan 6, 2015 at 8:23 AM
learn how to ask question!.