Is there any update query in cypher using which we can update the property of any node or relationship ?
For e.g. I have following node and relationship:
NodeA-[r:relatedTo]-NodeB
where relatedTo is a relationship having properties like active or inactive
How can I change this property using cypher query ?
You cannot rename an already existing relationship. You'd have to run through all relationships, create the new one in parallel (including all properties) and then remove the old one.
You can change the nodes associated with a label but you can't change the type of a relationship. Conceptually, if you take your chicken out of one coop and put it in another you haven't altered the substance of the chicken.
(b) Use Neo4j, by creating a node per key-value setting the key and value as properties on the node, but there is no relationship other then having an index to group these nodes together, exposing the key of the key-value as the key on the index.
With UNWIND , you can transform any list back into individual rows. These lists can be parameters that were passed in, previously collect -ed result or other list expressions. One common usage of unwind is to create distinct lists. Another is to create data from parameter lists that are provided to the query.
using SET
keyword in cypher query, see http://docs.neo4j.org/chunked/snapshot/query-set.html . (Since I have not came across any update query in cypher like in other RDBMS)
NodeA-[r:relatedTo]-NodeB
try to set value by : SET r.<your property name>="<desired value>";
before returning any value from start n=node(...)... return n;
query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With