content/commands/msetex.md
Atomically sets multiple string keys with an optional shared expiration in a single operation.
The number of keys being set.
</details> <details open><summary><code>key value [key value ...]</code></summary>A series of key/value pairs.
</details>The 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 Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | |
{{< multitabs id="return-info" tab1="RESP2" tab2="RESP3" >}}
[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 0 if none of the keys were set; 1 if all of the keys were set.
-tab-sep-
[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 0 if none of the keys were set; 1 if all of the keys were set.
{{< /multitabs >}}