Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit 03414b0

Browse files
committed
Update basic.py example with alternate way of using just host & port the regular redis-py way to connect to a cluster and not have to specify startup_nodes as a more complex object
1 parent 63e57b4 commit 03414b0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/basic.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
# Note: decode_responses must be set to True when used with python3
66
rc = RedisCluster(startup_nodes=startup_nodes, decode_responses=True)
7-
87
rc.set("foo", "bar")
8+
print(rc.get("foo"))
99

10+
# Alternate simple mode of pointing to one startup node
11+
rc = RedisCluster(
12+
host="127.0.0.1",
13+
port=7000,
14+
decode_responses=True,
15+
)
16+
rc.set("foo", "bar")
1017
print(rc.get("foo"))

0 commit comments

Comments
 (0)