Skip to content

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

@bobbintb

Description

@bobbintb

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions