StackExchange.Redis how to request all keys on only one db

I am new to redis, now I want to get all the keys in one db, not knowing about keys or key patterns. After googling, I found sodu code about my problem, but I don't have a key or data field in this code:

var connection = ConnectionMultiplexer.Connect(new ConfigurationOptions { EndPoints = { { DemoSettings.CustomerRedisCache.Url, DemoSettings.CustomerRedisCache.Port } }, Password = DemoSettings.CustomerRedisCache.Password }); var server = connection.GetServer(host: DemoSettings.CustomerRedisCache.Url, port: DemoSettings.CustomerRedisCache.Port); var cadena = "cust:" + data.SearchString.Replace(' ', ':')+"*"; var valores = server.Keys(pattern: cadena); 

thank you for your responses

+5
source share
1 answer

According to this link , the following code gets all the keys:

 var keys = myCacheClient.SearchKeys("*"); 
+7
source

All Articles