This is about RedisClient, which is a C++ client.
I know that you can't store integers in Redis (that are internally converted).
RedisSyncClient::command itself does not support integers as RedisBuffer can't be initialized with int, so:
redis->command("SET", "mykey", 1);
won't compile (you need to add numbers as string).
However RedisValue can be initialized with int (not sure when it is used) and it contains a public "toInt()" method:
redis->command("SET", "mykey", "1");
result = redis->command("GET", "mykey");
cout << "INT: " << result.toInt() << " , STR: " << result.toString() << endl;
INT: 0 , STR : 1
At first I thought that internally strings were being converted to int, but it always return "0". Testing "RedisValue.isInt()" it seems it fails to recognize numbers as it returns "false".
- What is the intention of "toInt()" if numbers are only seen (by this library) as strings?
- Am I using it incorrectly?
- Is this a work-in-progress feature?