Get the App
SLTechnology News&Howtos  ›  Database  › 

How many data types are there in redis

Shulou Source: shulou.com Published: 2022-05-31 22:36:04 10月03日 Update

This article will explain in detail how many data types there are in redis. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

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

Common commands of the 2.string type:

Self-added: incr

Self-subtracting: decr

Add: incrby

Minus: decrby

Common commands supported by the 3.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

Common commands supported by the 4.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

Common commands supported by the 5.hash data type:

Hset: adding hash data

Hget: getting hash data

Hmget: get multiple hash data

6.sort set is very similar to hash and is also storage in the form of mapping:

Zadd: addin

Zcard: query

Zrange: data sorting

5 data types of 1.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

Common commands of the 2.string type:

Self-added: incr

Self-subtracting: decr

Add: incrby

Minus: decrby

Common commands supported by the 3.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

Common commands supported by the 4.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

Common commands supported by the 5.hash data type:

Hset: adding hash data

Hget: getting hash data

Hmget: get multiple hash data

6.sort set is very similar to hash and is also storage in the form of mapping:

Zadd: addin

Zcard: query

Zrange: data sorting

This is the end of the article on "how many data types are there in redis". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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