MSETEX numkeys key value [key value ...] [NX | XX] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]
@write,
@string,
@slow,
Atomically sets multiple string keys with an optional shared expiration in a single operation. Supports flexible argument parsing where condition and expiration flags can appear in any order.
numkeysThe number of keys being set.
key value [key value ...]A series of key/value pairs.
condition and expiration flagsThe MSETEX command supports a set of options that modify its behavior:
NX -- Set the keys and their expiration time only if none of the specified keys exist.XX -- Set the keys and their expiration time only if all of the specified keys already exist.EX seconds -- Set the specified expiration time in seconds (a positive integer).PX milliseconds -- Set the specified expiration time in milliseconds (a positive integer).EXAT unix-time-seconds -- Set the specified Unix time in seconds (a positive integer) at which the key(s) will expire.PXAT unix-time-milliseconds -- Set the specified Unix time in milliseconds (a positive integer) at which the key(s) will expire.KEEPTTL -- Retain the time to live associated with the keys.| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ❌ Standard ❌ Active-Active |
❌ Standard ❌ Active-Active |