KEY *
KEY *字符*
For example, query key containing the character chen is available
KEY *chen*
TYPE key
EXISTS key
1.1 Query the value of string type key
GET string_key
1.2 Query the length of string type key
STRLEN string_key
1.3 Query the value of multiple string type key
MGET string_key1 [string_key2........]
2.1. Query a certain filed value of a single hash type key
HGET hash_key filed
2.2. Query multiple filed values of a hash type key
HMGET hash_key filed1 [filed2.......]
2.3. Query all filed values of hash type keys and their corresponding values
HGETALL hash_key
2.4. Query all filed values of hash type keys
HKEYS hash_key
2.5. Query all filed values of hash type keys
HVALS hash_key
2.6 Query the length of hash type key
HLEN hash_key
3.1.Query all elements of set type key
SMEMBERS set_key
3.2.Query the number of elements of set type key
SCARD set_key
4.1. Query the elements whose zset type key index is within a certain range
ZRNAGE zset_key start stop [withsocres]
4.2. Query the elements whose zset type key score is within a certain range
ZRNAGEBYSCORE zset_key start stop [withsocres]
5.1.Query elements whose list type key index is within a certain range
LRANGE list_key start stop
5.2.Query a certain index value of list type key
LINDEX list_key index
5.3. Query the length of list type key
LLEN list_key
The above is the detailed content of What are the basic data query commands in redis?. For more information, please follow other related articles on the PHP Chinese website!