如何使用Python-redis将Redis中的dicts列表与密钥保持一致.以下是我的目标数据结构:
'browsing_history' : {
'session_key_1' : [{'image': 'image-url', 'url' : 'url', 'title' : 'test_title', 'description' : 'test_description'}, {''image': 'image-url2', 'url' : 'url2', 'title' : 'test_title2', 'description' : 'test_description2'}],
'session_key_2' : [{'image': 'image-url', 'url' : 'url', 'title' : 'test_title', 'description' : 'test_description'}, {''image': 'image-url2', 'url' : 'url2', 'title' : 'test_title2', 'description' : 'test_description2'}],
}
Run Code Online (Sandbox Code Playgroud)
想要添加到会话列表中以及添加新会话以及还原它们.我怎么能用Python-redis做到这一点?