BaşlayınÜcretsiz Başlayın

Storing key-value data with Redis

Redis is a powerful tool used to store key-value pairs and is especially common in web applications. In this example, you're a developer creating a widget that shows the current weather for users of an application and leveraging Redis to cache this information.

To help get you stared, a connection to the Redis cluster has been created and is available in the variable redis_conn. Go get 'em!

Bu egzersiz

Introduction to NoSQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Store the value "London" at the key "city".
  • Using the key "sunshine", store the value 7
  • Retrieve the values stored at the "city" and "sunshine" keys, take a look at the printed results.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Store the city key-value pair
redis_conn.____("____", "London")

# Store the sunshine key-value pair
____.____("____", "____")

# Retrieve values stored at the city and sunshine keys
city = redis_conn.____("____")
sunshine = ____.____("____")

print(city)
print(sunshine)
Kodu Düzenle ve Çalıştır