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

Unable to push to an array in an entity without overwriting it or making extra system calls #246

Open
bobbintb opened this issue Oct 4, 2024 · 0 comments

Comments

@bobbintb
Copy link

bobbintb commented Oct 4, 2024

My schema has a string array and I am finding it difficult trying to efficiently push to it. This may be more of the fault of Redis but I'm not sure. By default Redis will update an existing entity when saving or create a new entity. But in the case where there is an array, it will overwrite the array if it exists. To work around this I have to check if the entity exists first before saving it and that doubles the number of call to Redis. The other option is programming around it but that also isn't ideal as I have to start tracking things which I am essentially trying to eliminate by using Redis.

Is there a better way to handle this, like a setnx?

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

1 participant