用redis做tag系统的示例:
例如:用户ltebean要给nodejs加一个标签amazing。代码:
sadd user:ltebean:tag:amazing nodejs sadd user:ltebean:item:nodejs amazing
拿tag amazing下所有的item,代码:
smembers user:ltebean:tag:amazing
用redis做tag系统的示例:
例如:用户ltebean要给nodejs加一个标签amazing。代码:
sadd user:ltebean:tag:amazing nodejs sadd user:ltebean:item:nodejs amazing
拿tag amazing下所有的item,代码:
smembers user:ltebean:tag:amazing