redis-cli SET user:1 'Alice'

Category: Databases & SQL

redis-cli SET user:1 'Alice'

Store a string value at a key

SET creates or overwrites the key. Keys are just strings; the colon-separated user:1 convention namespaces related keys. Add EX 3600 to expire the key. Related: GET, MSET.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.