redis MSET command
Translation results:
set
英[set] 美[sɛt]
vt. Set; place, arrange; put in a certain situation; place tableware
vi. Setting off; setting off; condensation
n.Gathering; a set; a set; a TV set
adj. Fixed; located in...; stubborn; arranged The
third person singular: sets plural: sets present participle: setting past tense: set past participle: set
redis MSET commandsyntax
Function:Set one or more key-value pairs at the same time. If a given key already exists, then MSET will overwrite the old value with the new value. If this is not what you want, consider using the MSETNX command: it will only work if all the given keys do not exist. Perform setting operations.
Syntax: MSET key value [key value ...]
Description: MSET is an atomic operation, all given Certain keys will be set at the same time. It is impossible for some given keys to be updated while other given keys have not changed.
Available versions: >= 1.0.1
Time complexity: O(N), N is the number of keys to be set.
Return: Always return OK (because MSET cannot fail)
redis MSET commandexample
redis> MSET date "2012.3.30" time "11:00 a.m." weather "sunny" OK redis> MGET date time weather 1) "2012.3.30" 2) "11:00 a.m." 3) "sunny" # MSET 覆盖旧值例子 redis> SET google "google.hk" OK redis> MSET google "google.com" OK redis> GET google "google.com"