Home > Database > Redis > An in-depth explanation of the 5 data types of redis

An in-depth explanation of the 5 data types of redis

coldplay.xixi
Release: 2021-04-29 18:12:18
forward
4505 people have browsed it

An in-depth explanation of the 5 data types of redis

1. 5 data types of redis:
string string (can They are integers, floating point types and strings, collectively referred to as elements)
list list (implementation of queue, elements are not unique, first-in-first-out principle)
set set (different elements)
hash hash scatter Column value (hash key must be unique)
sort set ordered set

Recommended (free):redis

##2 Common commands of .string type:

Self-increment: incr
Self-decrement: decr
Add: incrby
Subtract: decrby

An in-depth explanation of the 5 data types of redis 3. Common commands supported by list type :
lpush: Push from the left
lpop: Pop from the right
rpush: Push from the right
rpop: Pop from the right
llen: Check the length of a list data type

An in-depth explanation of the 5 data types of redis 4. Common commands supported by the set type:
sadd: add data
scard: check the number of elements existing in the set data
sismember: determine whether an element exists in the set data elements
srem: Delete elements in a certain set data

An in-depth explanation of the 5 data types of redis 5. Common commands supported by hash data type:
hset: Add hash data
hget: Get hash data
hmget: Get multiple hash data

An in-depth explanation of the 5 data types of redis 6. Sort set is very similar to hash, and is also a mapping form of storage:
zadd: add
zcard: query
zrange :Data sorting

An in-depth explanation of the 5 data types of redis

1. 5 data types of redis:

string string (can They are integers, floating point types and strings, collectively referred to as elements)
list list (implementation of queue, elements are not unique, first-in-first-out principle)
set set (different elements)
hash hash scatter Column value (hash key must be unique)
sort set ordered set

2. Common commands for string type:

Self-increment: incr
Self-decrement: decr
Add: incrby
Subtract: decrby

An in-depth explanation of the 5 data types of redis 3. Common commands supported by list type:
lpush: Push from the left
lpop: Pop from the right
rpush: From Right change and push
rpop: Pop from the right
llen: Check the length of a list data type

An in-depth explanation of the 5 data types of redis 4. Common commands supported by the set type:
sadd: Add data
scard: Check the number of elements present in the set data
sismember: Determine whether an element exists in the set data
srem: Delete an element in a set data

An in-depth explanation of the 5 data types of redis 5. Common commands supported by hash data type:
hset: Add hash data
hget: Get hash data
hmget: Get multiple hash data

An in-depth explanation of the 5 data types of redis 6.sort set and Hash is very similar and is also stored in the form of mapping:
zadd: add
zcard: query
zrange: data sorting

An in-depth explanation of the 5 data types of redis

The above is the detailed content of An in-depth explanation of the 5 data types of redis. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template