Files
spring-boot-demo/redis/docs/output/05-two-templates-two-keyspaces.txt

17 lines
542 B
Plaintext

# Same key name, two templates, two different keys
--- Write user:1 with StringRedisTemplate ---
stringTemplate.opsForValue().get("user:1") = from-string-template
redisTemplate.opsForValue().get("user:1") = null
--- Write user:1 with the default RedisTemplate ---
stringTemplate.opsForValue().get("user:1") = from-string-template
redisTemplate.opsForValue().get("user:1") = from-default-template
--- What Redis holds ---
$ redis-cli -p 6390 --no-raw DBSIZE
(integer) 2
$ redis-cli -p 6390 --no-raw GET user:1
"from-string-template"