gpt4 book ai didi

Redis - 更新集成员

转载 作者:可可西里 更新时间:2023-11-01 11:24:17 25 4
gpt4 key购买 nike

<分区>

我目前有一个像这样的redis,

redis in01apv16:6379> smembers key1
1) "{property1:value4,property2:value5,property3:value6}"
2) "{property1:value1,property2:value2,property3:value3}"

redis in01apv16:6379> smembers key2
1) "{property1:value1,property2:value2,property3:value3}"

redis in01apv16:6379> smembers key3
1) "{property1:value1,property2:value2,property3:value3}"
2) "{property1:value7,property2:value8,property3:value9}"

假设我需要为具有 property1=value7 的成员更新 key3 中的集合成员。我该怎么做?

我发现的一种方法是读取集合中的所有成员,然后对该特定集合成员执行 SREM。但这似乎太繁琐了,有没有更好的方法?

旁注:我正在使用 StackExchange.Redis(以防有办法直接从驱动程序执行此操作)

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com