Well ,I am using hiredis client in centos6 to connect redis server and using it's redisAppendCommand() to send command to the server.
redisContext *redisConnect(ip,port);
std::string value = "E 1";
std::string field_name = "field";
std::string id_code = "id";
std::string key = "HSET type:info:"+ id_code + " " + field_name + " " +value;
redisAppendCommand(_contxt, key.c_str());
It could not set value to E 1 as I wanted. Then I change code like this,
redisContext *redisConnect(ip,port);
std::string value = "E 1";
std::string field_name = "field";
std::string id_code = "id";
std::string key = "HSET type:info:"+ id_code + " " + field_name + " \"" +value + "\"";
redisAppendCommand(_contxt, key.c_str());
But the value would contain \" as it's content ,so value becomes \"E 1\", I just want to know if there any way to set value just E 1 with hiredis? Thank you.