You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "AadilBashir489 (via GitHub)" <gi...@apache.org> on 2023/06/19 13:14:40 UTC

[GitHub] [age] AadilBashir489 commented on issue #113: How to work with dynamic property

AadilBashir489 commented on issue #113:
URL: https://github.com/apache/age/issues/113#issuecomment-1597173727

   I also the got exact same issue. I posted it on stackoverflow and got the answer.
   Answer:
   You can later use the SET clause to insert the properties. Assuming that {name: 'John Doe'} is the JSON provided by the user, the following code demonstrates its usage:
   `SELECT * FROM cypher('test', $$
     CREATE (:Person)                   
   $$) AS (res agtype);                      
    res 
   -----
   (0 rows)
   
   SELECT * FROM cypher('test', $$
     MATCH (n:Person)
     SET n = {name: 'John Doe'} 
     RETURN n                
   $$) AS (res agtype);
                                             res                                   
          
   -----------------------------------------------------------------------------------------
    {"id": 1407374883553281, "label": "Person", "properties": {"name": "John Doe"}}::vertex
   (1 row)`
   
   If you intend to incorporate user input, you'll need to use one of the drivers available for AGE, such as the Python driver.


-- 
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