Suppose I have an Apache AGE graph database 'books'
in which some vertices have the pages
property stored in different types, as shown in the examples below:
SELECT * FROM cypher('books', $$
CREATE (v:Book {title: 'A book', pages: 10})
RETURN v $$) as (v agtype);
v
--------------------------------------------------------------------------------------------------
{"id": 844424930131969, "label": "Book", "properties": {"pages": 10, "title": "A book"}}::vertex
(1 row)
SELECT * FROM cypher('books', $$
CREATE (v:Book {title: 'Another book', pages: '10'})
RETURN v $$) as (v agtype);
v
----------------------------------------------------------------------------------------------------------
{"id": 844424930131970, "label": "Book", "properties": {"pages": "10", "title": "Another book"}}::vertex
(1 row)
Is there a way to update all occurrences of pages
of type string to type integer? In other words, is there a way to update the type of all properties of a particular type?