'How to know type of value of given key in redis in node js
I am doing a small project using redis and node js - redis client 'node_redis'. The problem is that, to get the key's value there are different get function like for string and integer type there is client.get, for array type there is client.lrange() etc. So how to identify what function to use to get the value if the desired value type is not known, is there a way to identify the value type.
Solution 1:[1]
Usually your application should know in advance the type of value that it is accessing using a given key name. That said, there's the Redis TYPE that you can use for inspecting a given key's type.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
