Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleRedisDocumentRepository.saveAll method adds two colon in key #386

Closed
Rohan-RPJ opened this issue Mar 1, 2024 · 1 comment
Closed
Assignees

Comments

@Rohan-RPJ
Copy link

Hi @bsbodden ,

I have a simple Entity class with @document("MYENTITY:") annotation over it, where MYENTITY: represents key prefix in cache.

On running repository.save(myEntityObj); method, it saves that object with key for eg: MYENTITY:1

But when trying to save multiple entity objects using repository.saveAll method, it saves all objects with required keys but with double colon instead of single. Eg: MYENTITY::2

Please check this issue, because ft.search would work for keys with double colon as well, but json.get is not working

@bsbodden
Copy link
Contributor

bsbodden commented Mar 1, 2024

Change "MYENTITY:" to "MYENTITY" - the convention is the Redis OM will take the prefix and concatenate it with the ID using :

My guess is that in save we are properly sanitizing the prefix and drop the : but on on saveAll - will check this but in general the rule is don't put the key prefix separator in the prefix explicitly. The saveAll behavior will be amended to drop the : if it is present as the last char in the prefix.

@bsbodden bsbodden self-assigned this Mar 1, 2024
bsbodden added a commit to bsbodden/redis-om-spring that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants