redox icon indicating copy to clipboard operation
redox copied to clipboard

Support commands returning vector<int>

Open czinn opened this issue 3 years ago • 0 comments

Some Redis commands, such as SMISMEMBER, return a list of integers. Trying to treat the reply as a vector doesn't work because the reply object has already parsed the data as integers, not strings. Supporting this is a simple change.

I've added an example of the usage in examples/data_types.cpp. It now prints:

Last 5 elements as a vector: 10 9 8 7 6 
Last 5 elements as a hash: 10 8 7 9 6 
Last 5 elements as a set: 10 6 7 8 9 
Are {1, 2, 3, 4, 5} in the set, respectively: 0 1 1 0 1 

czinn avatar Aug 20 '22 14:08 czinn