I'm trying to create a simple method in c# to get a count of keys in my Redis instance. In redis, I have my keys like:
mykey:1
mykey:2
mykey:3
By using redis-cli, I can run:
eval "return #redis.pcall('keys', 'mykey:*')" 0
and it returns:
(integer) 3
So, I build this function in c#:
public void GetThatCounter()
{
var script=LuaScript.Prepare("redis.pcall('keys', 'mykey:*')");
var result=dbCache.ScriptEvaluate(script);
Console.WriteLine("result"+result.ToString());
}
However, the result contains "isnull:true", meaning there are no results...
(The function is obviously returing nothing now, I'm just using it as a test and breaking code excecution on debug, to dig inside the result variable with the Visual Studio editor)
Any help ?
LuaScript.Prepare
parameter, not the C# code...#
symbol ? Which i guess gives the size of this array ?