How to create an Auto Incremented (Serial) attribute in Apache AGE ?
For example in the following query I want to add a new attribute order_id
that is unique and auto incremented every time I add a new order.
SELECT *
FROM cypher('online_orders', $$
CREATE(:User{name:"user1" ,email : "[email protected]" , phone:"123456" });
$$) AS (result agtype)
Since the attributes of nodes and edges are stored as a JSON object in the
properties
column, I believe this cannot be achieved only with the openCypher syntax. Also, AGE stores the ID of every node and edge, so creating anorder_id
property might be redundant. But you could do something like: create the user and set theorder_id
property to be the same as the nodeid
.