First, overview:
In the first few blogs of the series, the main focus is on commands related to Redis data types, such as String, List, Set, hashes, and Sorted-set. These commands all have one thing in common, that is, all operations are for the value associated with the key. This blog will focus on the Redis commands associated with
First, overview:
In the previous blogs of the series, the main focus was on commands related to Redis data types, such as String, List, Set, hashes, and Sorted-set. All of these commands have one thing in common, that is, all operations are for value associated with the key. The blog will focus on key-related Redis co
to the Redis directory to run the redis-cli.exe-h 127.0.0.1-p 6379 . Set the key-value pair set MyKey ABC Remove key value pair get MyKey 127.0. 0.1 6379
127.0. 0.1:6379set mykey yaohong
OK
127.0. 0.1:6379get mykey
"yaohong"
127.0. 0.1:6379>3. Configuration3.1 Getting th
set.Key.
IfMemberIf it is already a member of the sorted set, update thisMemberOfScoreValue, and re-insert thisMemberTo ensureMemberIn the correct position.
ScoreThe value can be an integer or a double-precision floating point number.
IfKeyOtherwise, an empty ordered set is created and the zadd operation is executed.
WhenKeyAn error is returned when an ordered set exists but is not of the type.
For more information about Ordered Sets, see sorted set.
# Add a single element
hashing type (hash) related Operations
We can consider the hashes type in Redis as a map container with string key and string value. Therefore, this type is ideal for storing information about value objects.such as username, password, and age. If a hash contains very few fields, the data of that type will take up only a small amount of disk space. Each hash can beTo store 4,294,967,295
First, overview:
In the previous blogs of the series, the main focus was on commands related to Redis data types, such as String, List, Set, hashes, and Sorted-set. All of these commands have one thing in common, that is, all operations are for value associated with the key. The blog will focus on key-related Redis
expiration time. Set an expiration time, it is necessary to do something.
used_memory_human:24.72gdb0:keys=144856453,expires=25357
The implementation of the keys prefix* through the tester causes Redis to die, and other connections are not connected. So positioning to the problem appears on the keys command, also as the manual says the performance problem.
How do I remove unused
Redis has deleted a single key in the command DEL, but there seems to be no bulk delete key instructions, but we can use the Linux xargs instructions to complete this action.
Copy Code code as follows:
REDIS-CLI Keys "*" | Xargs redis-cli del
If
Delete key in bulkThere is a command DEL that removes a single key in Redis, but it seems there is no instruction to delete the key in bulk, but we can do this with the Linux xargs command.
123
redis-cli keys "*"| xargs
about Redis
Redis serves as a cache server for hotspot data, as well as a variety of scenarios such as support queues and publish/subscribe, which are commonly used in many projects. The following descriptions can be found on the Redis official website Redis.io:
Redis is an open source (BSD licensed), IN-MEMORY data st
This blog mainly summarizes the common functions associated with key in Redis
1) Keys
Syntax: Keys pattern
Explanation: Finds all keys that match specified pattern patterns
[root@xsf001 ~]# redis-cli
redis 127.0.0.1:6379> keys * #所有key
1) "Score"
2) "Stu"
3 "Score1" c5
Redis is a representative of the Key-value database in the open source NoSQL, developed in C language, followed by BSD License. Supports memory, disk persistence storage, and it has a very rich data type, including strings, linked lists, ordered collections, and so on. High availability comes with a master-slave architecture, and cluster functionality is being developed and is well worth looking forward to.
Description:A Web service, the original business logic is to cache the results of the MySQL query in Redis for one hours, speeding up the response of the request. One problem now is that the response of the corresponding encoding is returned based on the specified encoding of the request.The first is to modify the response of the body encoding, because MySQL is going out is Unicode, so directly use "content = Content.encode (charset)"To convert, and t
key in this library, then we move the key from database 0 to database 1, then we confirm that there is no such key in database 0, but in database 1 there is this key, indicating that we transferred successfully 6, persistTo remove the expiration time for a given key:Redis
Some projects use redis storage. It is troublesome to rehash redis. So I wrote a simple key method to read redis to the database. For reference only.
Package com. redis. web; import java. util. date; import java. util. iterator; import java. util. set; import
Redis has a command to delete a single piece of data del but he doesn't have a way to delete multiple pieces of data in bulk, so how do we delete multiple pieces of data in bulk?The first way' volume:* ' | Xargs delComments:by: Keys ' Volume ' to match the Key:value entry you want to delete, then Pass the result to Xargs and delete the dataIf you want to remove the specified
This article provides a detailed analysis of the experiences of using the keyvalue database redis and TTSERVER. For more information, see
Redis firstRedis is a key/value storage system similar to memcached. it supports a large number of storage value types, including string, list, and set) and zset ). On this basis, redis
First, Redis.Redis is a memcached-like key/value storage system that supports a relatively large number of stored value types, including string (string), list (linked list), set (set), and Zset (ordered collections). Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that
Redis firstRedis is a key/value storage system similar to memcached. It supports a large number of storage value types, including string, list, and set) and zset ). On this basis, redis supports sorting in different ways. Like memcached, data is cached in the memory to ensure efficiency. The difference is that redis pe
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.