Redis supports five data types:
string (string)
hash (hash)
list (list)
set ( Set)
zset(sorted set: ordered set)
redis determines whether the value exists
In SISMEMBER in the set and ZRANK, ZREVRANK, and ZSCORE in the ordered set can all determine whether a member is in the set!
Example:
The set command in redis to determine whether a certain value exists in the value of a certain key: sismember, if it exists, it returns 1, if it does not exist, it returns 1 Return 0
127.0.0.1:6379>sismember mySet 3 ---返回值为0,因为myset的set成员中只有1,2没有3 127.0.0.1:6379>sismember mySet 2 ---返回值为1,因为myset的Set成员中存在2.
The above is the detailed content of Redis determines whether the value exists. For more information, please follow other related articles on the PHP Chinese website!