草庐IT

database - redis数据库中HSET和HMSET方法有什么区别

在我的应用程序中,我使用的是redis数据库。我已经阅读了他们的文档,但我找不到HSET和HMSET之间的区别。 最佳答案 HSET过去只能设置一个键值对。如果您需要一次设置多个,则必须使用HMSET(M表示多)。这在几年前发生了变化,允许两个命令接受多对。现在HMSET是多余的。来自officialdocumentation:AsperRedis4.0.0,HMSETisconsidereddeprecated.PleaseuseHSETinnewcode. 关于database-re

hash - 如何在redis中 "EXPIRE" "HSET"子键?

我需要使redis散列中超过1个月的所有键过期。 最佳答案 Thisisnotpossible,为了keepingRedissimple.QuothAntirez,Redis的创造者:Hi,itisnotpossible,eitheruseadifferenttop-levelkeyforthatspecificfield,orstorealongwiththefiledanotherfieldwithanexpiretime,fetchboth,andlettheapplicationunderstandifitisstillva