每个Redisson对象实例都会有一个与之对应的Redis数据实例,可以通过调用getName方法来取得Redis数据实例的名称(key)。

    1. RMap map = redisson.getMap("mymap");
    2. map.getName(); // = mymap

    所有与Redis key相关的操作都归纳在RKeys这个接口里:

    1. RKeys keys = redisson.getKeys();
    2. Iterable<String> allKeys = keys.getKeys();
    3. Iterable<String> foundedKeys = keys.getKeysByPattern('key*');
    4. long numOfDeletedKeys = keys.delete("obj1", "obj2", "obj3");
    5. long deletedKeysAmount = keys.deleteByPattern("test?");
    6. String randomKey = keys.randomKey();
    7. long keysAmount = keys.count();