Get the App
SLTechnology News&Howtos  ›  Database  › 

How to view the five data types of redis

Shulou Source: shulou.com Published: 2022-05-31 23:12:53 10月03日 Update

The editor will share with you how to view the five data types of redis. I hope you will get something after reading this article. Let's discuss it together.

1. 5 data types of redis:

String string (can be integer, floating-point, and string, collectively referred to as elements)

List list (implementation queue, non-unique elements, first-in, first-out principle)

Set collection (different elements)

Hash value (key for hash must be unique)

Sort set ordered set

2. Common commands of string type:

Self-added: incr

Self-subtracting: decr

Add: incrby

Minus: decrby

3. Common commands supported by list type:

Lpush: push in from the left

Lpop: pop up from the right

Rpush: push from the right

Rpop: pop up from the right

Llen: view the length of a list data type

4. Common commands supported by set type:

Sadd: adding data

Scard: view the number of elements that exist in set data

Sismember: determines whether an element exists in set data

Srem: delete an element from an set data

5. Common commands supported by hash data types:

Hset: adding hash data

Hget: getting hash data

Hmget: get multiple hash data

6. Sort set and hash are very similar, but also storage in the form of mapping:

Zadd: addin

Zcard: query

Zrange: data sorting

After reading this article, I believe you have a certain understanding of "how to view the five data types of redis". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Data type element command common support right character string article order similarity same number principle multiple finished form more floating point Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Microsoft vpn OPPO Reno Apple