Today, using C # to connect Redis for performance testing, with the interface is Stackexchange.redis, according to the normal idea of getting the database connection, the code is as follows:
1 string conn = "my ip: 6379, password = login password";
2
3 ConnectionMultiplexer client = ConnectionMultiplexer.Connect (conn);
4
5 IDatabase db = client.GetDatabase (2);
Then add the data to the inside, similar to the following code:
1 RedisKey key ="1";
2
3 RedisValue value = "....";
4
5 this.db.SetAdd(key, value);
After you finish, use REDIS-CLI to connect to Redis with the following command:
192.168. 1 6379 -a login password
After successful login to get the way to obtain such as: Get 1, found an error:Wrongtype operation against a key holding the wrong kind of value, to the Internet to see there is said to repeat the value of what is said, after To check the code to see that I was adding data using this.db.SetAdd (key, value); The meaning of this sentence is to add code to the collection and later modify it to This.db.StringSet (key, value); Everything's fine.
Originally is a very basic problem check AH check, also thought is the key value or value values appear special characters caused by, check for half a day, if later brothers encounter like me the same problem may go to see your type is not a problem, to the time when using get error, with Smembers 1 We can all come out. It's a collection, the Novice brothers learn together, the old birds don't bother me, this is not for the veteran to see
Wrongtype operation against a key holding the wrong kind of value: type mixed up error