Skip to content
masterclass Buddy

Upstash · Method

redis.set

Stores a value at a Redis key. It supports conditional writes, expiration settings, preserving an existing expiration, and returning the old value.

Last updated

Syntax

redis.set(key, value, get=False, ex=None, px=None, exat=None, pxat=None, keepttl=False, nx=False, xx=False)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • get
  • getset
  • mset
  • msetnx
  • setrange

Source: SET - Upstash Documentation. Checked 2026-11-03.