我们如何使用stackexchange redis客户端来执行FlushAll和FlushDB redis命令?
答案 0 :(得分:6)
project homepage有一个Documentation section,其中包含Where are KEYS, SCAN, FLUSHDB etc?
简短的回答是:通过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