Given the following code
from redis_om import HashModel, JsonModel
import redis
r = redis.Redis(host='localhost', port=6379, db=2)
kwargs = {'key1': 'value1', 'keyn': 'value2'}
jsonModel = JsonModel(**kwargs)
jsonModel.save()
print(jsonModel.key()) # example: :redis_om.model.model.JsonModel:01GB7B0V33424C9SDK6FM8496Q
How do I go into redis-cli
and view the JSON Model in redis? (Assuming I have correctly loaded the RedisJSON module into redis server).
I'm really new to redis so I tried things like the following but I really have no idea and still finding my way around the documentation.
127.0.0.1:6379[2]> get :redis_om.model.model.JsonModel:01GB7B0V33424C9SDK6FM8496Q
(nil)
127.0.0.1:6379[2]> json.get :redis_om.model.model.JsonModel:01GB7B0V33424C9SDK6FM8496Q
(nil)