cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Different node properties based on a relationship property

Hi,
Is it possible to create nodes (with the same label) that have different properties based on a relationship property?

For example, if the relationship is [:HAS_RELATIONSHIP { type: "A" }], I want the target node has Property1 and Property2, if [:HAS_RELATIONSHIP { type: "B" }] the target node has Property3 and Property4.

Thanks for the answers.

Beatriz

1 REPLY 1

Hello Beatriz,

Yes you can create any number of properties for a node or relationship. There is no restriction for the number or name of properties on a particular node or relationship. The only restriction would be if you placed an exists constraint on a node. This would then mean that when you create a node of a given type, it MUST have a particular property or an error will be raised.

Elaine