Loading all entries from a hash where fields are dynamic and have a struct type #2706
Unanswered
arodrigues79
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'd like to use a redis hash to represent tickets, so that I can I write each one individually and be able to retrieve them all at once. Tickets are represented by a struct.
It is not clear to me how I should read all tickets.
HGetAll
returns a*StringStringMapCmd
, on which I could callResult
. Supposing I encoded the struct using json, would I then convert each value to[]byte
and then decode it?It looks like
Scan
is meant for structs with known fields (annotated with`redis:"field"`
).Any hints? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions