neomodel
neomodel copied to clipboard
How can I add a new relationship property dynamically
When I create some connections between nodes, I want to add some properties that not exist at the model of that Rel. How can I make this work?
class myRelationship(StructuredRel):
prop1 = StringProperty()
prop2 = IntegerProperty(default=0)
<--- how I can add newProp = StringProperty() dynamically here?
node1.myRelattionship.connect(node2, {"prop1": "value1", "prop2": 9999, "newProp": "new value"})
Thanks!
@gazambuja I don't think you can do that. Your models have to be fixed. Perhaps what you could do in a circuitous way is use a JSONProperty.
Adding properties dynamically is not supported in neomodel and currently not a development target. The only option for you here is a JSONProperty, as @enjoysmath said.