php - Update/append redis values -
i have started using redis. it's simple key value storage. example:
$this->redis->set('get_all_devices', json_encode($data));
now if there new entry device table, want append new entry same cached data have. don't want flush cached object , create new 1 reflect new entry. there way in redis?
there no table in redis. must learn redis specific data types are.
in case, set right structure used, if don't need data ordered. should perform sadd (adds value set) instead of set instruction, sets value single string.
$this->redis->sadd('get_all_devices', json_encode($data));
according use case, list or sorted set may more appropriate set store data.
Comments
Post a Comment