Skip to content

Loading single struct field #179

Answered by marvin-j97
nuuvil asked this question in Q&A
Discussion options

You must be logged in to vote

When you serialize a struct, it's just a blob of bytes, the storage engine doesn't understand it.
You'll need to separate your entities, and design key prefixes to sort them:

r#{room_id} => ROOM_DATA
m#{room_id}#{member_id} => MEMBER_DATA

(# being the NULL terminator).

Then you get the room (without members) using db.get("r#room25") and the members using db.prefix("m#room25#")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nuuvil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested data modelling
2 participants