spring-guides / gs-spring-data-reactive-redis

Accessing Data Reactively with Redis :: Learn how to reactively interface with Redis and Spring Data

Home Page:https://spring.io/guides/gs/spring-data-reactive-redis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

coffeeOps.opsForValue().set() failed

fsh1234 opened this issue · comments

commented

I am trying to add data to redis like this:
@PostMapping("/add")
public Flux add() {
String coffeeId = UUID.randomUUID().toString();
coffeeOps.opsForValue().set(coffeeId, new Coffee(coffeeId, "add Redis"));
return coffeeOps.keys("*")
.flatMap(coffeeOps.opsForValue()::get);
}

But it doesn't work, what should I do?