Connecting to a Redis cluster
You'll use Python to store and retrieve key-value data with Redis. In this exercises, you'll explore the basics of connecting to a Redis cluster running locally. Good luck!
Latihan ini adalah bagian dari kursus
Introduction to NoSQL
Petunjuk latihan
- Import the appropriate library to work with Redis using Python.
- Create a connection to the Redis cluster running
localhostover port6379. - Make sure data is decoded when retrieved from Redis.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
import ____
# Create a connection to Redis cluster
r = redis.Redis(
host="____",
port=____,
decode_responses=____
)