Closed
Description
this.reactiveRedisTemplate.getConnectionFactory()
.getReactiveConnection()
.zSetCommands()
.zAdd(Mono.just(
ReactiveZSetCommands.ZAddCommand
.tuple(new DefaultTuple(
ByteUtils.getBytes(ByteBuffer.wrap(storeSkuId.getBytes())),
(double)(LocalDateTime.now().toEpochSecond(ZoneOffset.UTC))))
.to(ByteBuffer.wrap(storeId.getBytes()))
.xx()));
In the Redis official document, it claims that XX only update elements that already exist. Don't add new elements. However, the above code will still insert a non-exist element.
Also, why it will use flag called upsert to represent whether it is nx or xx? The meaning of upsert does not match with the actual usage of them.