Redis issue with unique key

时间:2015-06-25 18:40:13

标签: php redis hex redistributable

Im fairly new to redis and new to hex. As i understand, i need an unique key,then i can add multiple fields in it. im going to save alot of user information using hget and hset. I was planning to use it something like "user useridHere: password $password" ETC if you are see. for example user 1: password pass123 and to get the password hget("user 1: password"); But because i cant serach user information without the userid, because redis is depending on the key, i dont know how i should proceed. My user is going to login with their username and password and i need to search for a match. as i dont want to do user stackoverflow: password, i need to find another way, because the username is changeable. How should i save my accounts in redis and search in them for their username and password for match?

1 个答案:

答案 0 :(得分:0)

如果我是你,我会将用户名存储在Redis中,然后如果他们更改了用户名,只需删除该用户名条目并创建一个新用户名。

相关问题