I'm working on a system deals with dynamic properties.
If I want to create a vertex, I can do it like this before that:
select * from ag_catalog.cypher('people',$$
create (nyk:person{name:'nyk'})
return nyk
$$) as (v ag_catalog.agtype);
But now, I don't know the property, the property is given by the user as a json object.
The property may be {name:'asdf'} or {name:'asdf', age:25} or {name:'asdf', work:'programmer'} ....
I don't know what property will get.
The problem is same when using the delete,update or get method. So how to deal with that? Can I bind the property with a json parameter?
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:If you intend to incorporate user input, you'll need to use one of the drivers available for AGE, such as the Python driver.