Closed GoogleCodeExporter closed 8 years ago
When a key is removed it becomes every type: GET replies with "nil", LLEN
replies with 0, SCARD replies with 0, etc. The only difference is that EXISTS
replies with 0, and the key doesn't appear in the result set of KEYS (since it
doesn't exist...). This will not be made configurable, since it doesn't really
serve a purpose in my opinion. Your application will have knowledge which keys
map to which types, and is therefore likely to only call list commands against
keys that are expected to hold a list. When this key doesn't exist, all
commands reply with a value as if the list was empty. I think this should cover
many, if not all use cases.
If you need to know if a key ever *existed* (note the past tense), you can work
around this by setting another key to 1 or something like that. This can just
act as a flag that you request every time you call a command against a list.
When this replies with a 1, the key has existed in the past, otherwise it
hasn't.
Original comment by pcnoordh...@gmail.com
on 19 Jul 2011 at 8:58
thks for your datail response, but i thought there still something you might
misunderstand of what i mentioned.
we have a scenario like this :
like most applications ,we do a query operation with an empty table from
database , that means none record come out.
so in this case we want to create an empty list to redis that can avoid access
database every time but from redis, otherwise we will do the same query
from database every time,as we know that is not a good solution. but now the
issue is redis will automatically remove an empty list.
in a word ,how can i keep a empty list in redis and it will not remove by redis
but by manual ? hope this can help you known what i really means .
Original comment by jel...@gmail.com
on 21 Jul 2011 at 3:06
Original issue reported on code.google.com by
jel...@gmail.com
on 19 Jul 2011 at 8:40