如何使用c#在stackexchange redis客户端上执行flush命令

NAN*_*HOR 2 c# stackexchange.redis

我们如何使用stackexchange redis客户端来执行FlushAll和FlushDB redis命令?

Mar*_*ell 6

项目主页有一个文档部分,其中包括在哪里是关键,SCAN,FLUSHDB等?

简短的回答是:通过IServer.文档包括"为什么".

// 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
Run Code Online (Sandbox Code Playgroud)