Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-07-2020 07:18 AM
Hi all.
How do go about modeling codes and their labels?
Say I have a person status that is represented by an integer code in the person node (1, 2).
Where would you hold the labels info for these codes: 1=Active and 2=Inactive?
I thought of a a detached branch in the DB for all these codes-labels chains for all such fields, like:
SystemTables -> PersonStatus -> 1=Active -> 2=Inactive
SystemTables -> MembershipLevel -> 1=Lead -> 2=Pre-Member -> 3=Subscribed
Any other ideas?
09-07-2020 09:59 AM
I think that PersonStatus and MembershipLevel are properties of Person:
ciao
Alessio
09-07-2020 10:04 AM
Thanks Alessio.
Yes, they are, but I'm just storing the numeric code for every person:
Status=1
MembershipLevel=3
Storing just a numeric code ("1") instead of a string ("Active") should save a lot of space for Million members (and that just for onen field. Like Status and MemebershipLevel I have many other codes fields in the system).
I need to store somewhere the labels per each code I'm using:
1 represents "Active"
2 represents "Inactive"
etc...
My question is how should I model the small storage of just the codes' labels (meaning).
09-07-2020 10:32 AM
Hi Mor,
The first Idea is to create a little graph named "Legenda" with all the decode of the value of the structure.
ciao
Alessio
09-07-2020 10:51 AM
Yes, that was my initial thought. I thought there's something more elegant I'm missing here...
Thanks!
09-08-2020 01:48 AM
I think that MembershipLevel is self-explanatory, for binary value as Active/Inactive you can use the standard 0=false 1=true
Alessio
All the sessions of the conference are now available online