Como executar comandos flush no cliente stackexchange redis usando c#
-
26-12-2019 - |
Pergunta
Como podemos executar os comandos redis FlushAll e FlushDB usando o cliente stackexchange redis?
Solução
O página inicial do projeto tem um Seção de documentação, que inclui Onde estão KEYS, SCAN, FLUSHDB etc?
A resposta curta é:através da IServer
.A documentação inclui o "porquê".
// get the target server
var server = conn.GetServer(someServer);
// completely wipe ALL keys from database 0
server.FlushDatabase(); // database number is optional and defaults to 0
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow