public class Example {
@Autowired
ReactiveRedisOperations<String, String> redisOperations;
@Autowired
RedisScript<Boolean> script;
public Flux<Boolean> checkAndSet(String expectedValue, String newValue) {
return redisOperations.execute(script, singletonList("key"), expectedValue, newValue);
}
}
The following example does not work:
https://github.com/spring-projects/spring-data-redis/blob/main/src/main/antora/modules/ROOT/pages/redis/scripting.adoc?plain=1#L55
Correct code will be: