300 字 | 1 分钟

iterall storeid hex num

Available since 1.0.0.

命令说明

用于迭代所有的key value。

输入参数:storeid hex num

其中hex第一次传入0,返回的hex值用于下一次迭代,可以反复迭代,直到返回hex为0表示结束。

命令返回

下一次迭代用的hex

数据库中的key value列表,格式如下:

1)数据类型,参见下面的RecordType

2)dbId

3)一级key

4)二级key

5)value

  1. enum class RecordType {
  2. RT_INVALID,
  3. RT_META, /* For catalog */
  4. RT_KV, /* For realtype in RecordValue */
  5. RT_LIST_META, /* For realtype in RecordValue */
  6. RT_LIST_ELE, /* For list subkey type in RecordKey and RecordValue */
  7. RT_HASH_META, /* For realtype in RecordValue */
  8. RT_HASH_ELE, /* For hash subkey type in RecordKey and RecordValue */
  9. RT_SET_META, /* For realtype in RecordValue */
  10. RT_SET_ELE, /* For set subkey type in RecordKey and RecordValue */
  11. RT_ZSET_META, /* For realtype in RecordValue */
  12. RT_ZSET_S_ELE, /* For zset subkey type in RecordKey and RecordValue */
  13. RT_ZSET_H_ELE, /* For zset subkey type in RecordKey and RecordValue */
  14. RT_BINLOG, /* For binlog in RecordKey and RecordValue */
  15. RT_TTL_INDEX, /* For ttl index in RecordKey and RecordValue */
  16. RT_DATA_META, /* For key type in RecordKey */
  17. };

Example

  1. 127.0.0.1:51003> hset myhash key1 value1
  2. 127.0.0.1:51003> set a 1
  3. 127.0.0.1:51003> set b 2
  4. 127.0.0.1:51003> iterall 0 0 2
  5. 1) "00003C8744000000006100000100"
  6. 2) 1) 1) "2"
  7. 2) "0"
  8. 3) "b"
  9. 4) ""
  10. 5) "2"
  11. 2) 1) "6"
  12. 2) "0"
  13. 3) "myhash"
  14. 4) "key1"
  15. 5) "value1"