You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "abdulmanann (via GitHub)" <gi...@apache.org> on 2023/05/30 12:25:50 UTC

[GitHub] [age] abdulmanann commented on issue #934: Updating properties for multiple nodes in a graph database using a single query without specifying each node individually

abdulmanann commented on issue #934:
URL: https://github.com/apache/age/issues/934#issuecomment-1568344216

   Absolutely, you can update properties of multiple nodes in a single query without specifying each node individually. The answers provided have illustrated this well.
   
   1. **Update nodes based on a condition**:
       ```cypher
       MATCH (n:label) WHERE n.Property = 'existing value' 
       SET n.newProperty = 'new value'
       ```
   In this case, all nodes with the specified label and the property that matches the given existing value will have their newProperty updated to 'new value'.
   
   2. **Update all nodes of a specific label**:
       ```cypher
       MATCH (n:label)   
       SET n.newProperty = 'new value'
       ```
   Here, all nodes with the given label will have their newProperty updated to 'new value', irrespective of their current properties.
   
   You can choose between these methods based on whether you want to update properties of all nodes of a specific label or only those nodes that meet certain conditions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org