如何使用java在redis db中获取哈希列表?
答
如果您详细了解Redis API,并不难。
Set<String> hashes = new HashSet<>();
RKeys keys = redisson.getKeys();
keys.getKeys().forEach(key -> {
if (RType.MAP.equals(keys.getType(key))) {
hashes.add(key);
}
});
这是使用Redisson作为客户端编写的示例。
答
我尝试过使用jedis客户端。
以下语法有助于获取散列列表。
Scan 0 Match FolderName:* count 10000
其工作得很好。
嘿谢谢你的回答。@ Redisson_RuiGu – sathya