如何获得redis中的所有集合? [英] How can I get all of the sets in redis?

查看:73
本文介绍了如何获得redis中的所有集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 KEYS 命令,但它只返回键(我猜所有类型为 String 的键),显然集合不被视为键.

I know the KEYS command, but that only returns the keys (I'm guessing all of the keys with type String), and apparently sets aren't considered keys.

是否有获取数据库中所有集合的命令?其他数据类型(散列、列表、排序集)呢?

Is there a command for getting all of the sets in the database? What about other data types (hash, list, sorted set)?

http://redis.io/topics/data-types

推荐答案

我知道 KEYS 命令,但它只返回密钥(我猜所有字符串类型的键),显然集合不是考虑的关键.

I know the KEYS command, but that only returns the keys (I'm guessing all of the keys with type String), and apparently sets aren't considered keys.

KEYS 命令无论您的键是什么数据类型都会返回结果,因为它搜索键名.在最低抽象级别,redis 中的每种数据类型都是基于键/值的,其中值可以表示为几种(高级)数据结构(字符串、哈希、列表、集合、排序集合)之一.您可以看到 KEYS 命令也适用于 examples 中的集合.

KEYS command return results no matter what data type are your keys, since it searches key names. At the lowest level of abstraction each data type in redis is key/value based where value can be represented as one of several (advanced) data structures (string, hash, list, set, sorted set). You can see that KEYS command also work for sets in it's examples.

是否有获取数据库中所有集合的命令?什么关于其他数据类型(散列、列表、排序集)?

Is there a command for getting all of the sets in the database? What about other data types (hash, list, sorted set)?

据我所知,此功能没有专用命令,KEYS 命令应用于数据库的整个数据集.但是有一个 TYPE 命令可以确定指定键的数据类型.

As far as I know there is no dedicated command for this functionality and KEYS command is applied on entire data set of your database. However there is a TYPE command which can determine data type of specified key.

这篇关于如何获得redis中的所有集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆