From enum flag to neo4j nodes / relationships. How to map the data into neo4j?

(M Pasadu) #1

Hey,
I have a enum flag e.g.

[Flag]
public enum MyFlagEnum{
None = 0,
Flag1 = 1,
Flag2 = 2
Flag3 = 4
}

So you can do bitshift operations and combine flags.
How would you store/model such a construct in Neo4j? I want to be able to remove/add flags on thousands of nodes/data at once.

0 Likes

(Michael Hunger) #2

If you have only a few options, I would use Labels.

Which you can add/remove at will.

0 Likes

(Omerule) #3

Maybe you can use the APOC library which has bitwise operators:
https://neo4j-contrib.github.io/neo4j-apoc-procedures/#bitwise-operations

Yours kindly
Omer

0 Likes