Harshit
Harshit

Reputation: 1217

Neo4j How to add multiple values to the property of a node

While i am creating nodes for one of the problem , I am stuck, after going through documentation I realised I couldn't find multi value property assignment to the node

For eg: Node 1 have property Websites visit, since it cannot be a single website , how to add property to Node 1 "website" such that it can take two values like www.abc.com www.def.com

node1["websites"] = "www.abc.com" "www.def.com"

Such that while accessing each property of a node each website in a node property can be accessed individually.

Thanks for your time !

Upvotes: 3

Views: 3175

Answers (2)

RaduK
RaduK

Reputation: 1463

You can use an array as the value of your 'website' property: http://docs.neo4j.org/chunked/milestone/graphdb-neo4j-properties.html

Upvotes: 5

ulkas
ulkas

Reputation: 5918

wouldn't it be better to do it the graph way and create a node for each website, than simply create relationship between the node1 and the websites nodes?

anyway, for modyfying arrays you may take a look at: https://groups.google.com/forum/?fromgroups=#!topic/neo4j/bY5GXWYpM1k

Upvotes: 5

Related Questions