英文:
Unable to retrieve persisted data with spring data redis
问题
I am new to redis but understand the fundamentals. I am trying to add users to a list that have joined a chatroom. I am using the RedisTemplate from spring data redis.
Added is done via: redisTemplate.opsForList().rightPush("voting", user.getName());
On the redis server using KEYS *
returns: 2) "\xac\xed\x00\x05t\x00\x06voting"
However using: GET
and I keep seeing nil using:
- "\xac\xed\x00\x05t\x00\x06voting"
- "voting"
as keys.
I'm not sure what the prefix of \xac\xed\x00\x05t\x00\x06
is? Could anyone explain. Thanks
英文:
I am new to redis but understand the fundamentals. I am trying to add users to a list that have joined a chatroom. I am using the RedisTemplate from spring data redis.
Added is done via: redisTemplate.opsForList().rightPush("voting", user.getName());
On the redis server using KEYS *
returns: 2) "\xac\xed\x00\x05t\x00\x06voting"
However using: GET
and I keep seeing nil using:
- \xac\xed\x00\x05t\x00\x06voting
- voting
as keys.
I'm not sure what the prefix of \xac\xed\x00\x05t\x00\x06
is? Could anyone explain. Thanks
答案1
得分: 1
我自己的愚蠢。关键是 org.bson.ObjectId
而不是 java.lang.String
。
使用 MONITOR
在 redis 上能帮我看到错误。
英文:
My own stupidity. The key was an org.bson.ObjectId
not a java.lang.String
using the MONITOR
on the redis was able to help me see the error
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论