summaryrefslogtreecommitdiff
path: root/doctests/string_set_get.py
blob: f7dfda14764be70a729db5220a924f0109d7fff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# EXAMPLE: set_and_get
# HIDE_START
import redis

r = redis.Redis(host="localhost", port=6379, db=0, decode_responses=True)
# HIDE_END

res = r.set("bike:1", "Process 134")
print(res)
# >>> True
# REMOVE_START
assert res
# REMOVE_END

res = r.get("bike:1")
print(res)
# >>> "Process 134"
# REMOVE_START
assert res == "Process 134"
# REMOVE_END