Strings type :? Set the value corresponding to KEY to STRING type value .? The simplest data is binary secure. Can it contain any data .? For example, JPG images or serialized objects .?? Operation: setnamevalue ;?? 2: setnx sets the value corresponding to the KEY to a STRING type value. If the key already exists, 0 is returned; 3: setex? Set
Strings type :? Set the value corresponding to KEY to STRING type value .? The simplest data is binary secure. Can it contain any data .? For example, JPG images or serialized objects .?? Operation: set name value ;?? 2: setnx sets the value corresponding to the KEY to a STRING type value. If the key already exists, 0 is returned; 3: setex? Set
Strings type:
? Set the value corresponding to the KEY to a value of the STRING type.
? The simplest data is binary secure. It can contain any data.
? For example, JPG images or serialized objects.
?? Operation: set name value;
??
2: setnx sets the value corresponding to the KEY to the STRING type value. If the key already exists, return 0;
3: setex? Set the value of the KEY to a value of the STRING type and specify the validity period of the KEY value.
?? Setex twnmae 10 red;
??
4: setrange sets the substring of the value of the specified KEY.
??
?? Setrange name 6 tangwen.org ?? Replace the value with tangwen.org.
5: mset sets the value of multiple keys at a time. 0 k is returned for success, and 0 is returned for failure;
? Mset key1 value1 key2 value2
6: getset
? Set the new value of the key and return the old value of the key.
7: getrange gets the substring.
? Getrange name 0, 6? Returns the subscripts starting from 0 to 6.
8: mget
? Batch query. If the corresponding KEY does not exist, nil is returned.
9: incr
?? The value of the KEY increases progressively.
10: incrby
? Incrby key 5; increments by five keys.
For example:
Redis 127.0.0.1: 6379> set key1 12
OK
Redis 127.0.0.1: 6379> get key1
"12 ″
Redis 127.0.0.1: 6379> incr key1
(Integer) 13
Redis 127.0.0.1: 6379> incrby key1 2
(Integer) 15
Redis 127.0.0.1: 6379>
11: decr: subtract the key value.
12 decrby is similar to decr, and the specified value is subtracted.
13: append the value to the string of the specified KEY, and return the length of the new string value.
Install Nosql Redis in centos