DEV Community

Chidera Stella Onumajuru
Chidera Stella Onumajuru

Posted on

The Apache AGE REMOVE Clause.

Apache AGE(AGE) is a PostgreSQL extension that enables hybrid queries using PostgreSQL. The AGE REMOVE clause is used to delete a property from nodes and relationships. In this previous blog post I wrote about the SET clause which can be used to delete a property as well.

The graph that is being queried in this tutorial has been created in a previous tutorial here and its contents it as follows.

An image showing the vertices we are working with

Now let's make a query, to remove the property Description from the vertex food.

SELECT * FROM cypher('food', $$ MATCH (food_blog {name: 'Tasty Delight'})REMOVE food_blog.Description RETURN food_blog $$) as (food_blog agtype);
Enter fullscreen mode Exit fullscreen mode

Image showing the returned query

The query returned the Vertex food_blog with just the name property, as seen in the image above.

Conclusion
The AGE REMOVE just like the SET clause is quite useful in deleting properties from Nodes and Relationships.

References
https://age.apache.org/age-manual/master/clauses/remove.html

Further Reading on AGE
https://dev.to/chidera/a-simple-guide-to-graph-databases-for-beginners-3log
https://dev.to/chidera/creating-your-first-graph-database-7mm
https://dev.to/chidera/understanding-age-skip-and-limit-clauses-3n2a
https://dev.to/chidera/apache-age-set-clause-41m7
https://dev.to/chidera/understanding-the-apache-age-delete-clause-5704

Top comments (0)