redis-cli MSET user:1 'Alice' user:2 'Bob'

Category: Databases & SQL

redis-cli MSET user:1 'Alice' user:2 'Bob'

Set multiple keys in one round trip

Sets several keys atomically in a single network call, much faster than repeated SET. MGET fetches them back together. Related: GET.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.