1

I created a vertex with a property called interests and it should store an array of strings.

SELECT * FROM cypher('DatingApp', $$
    CREATE (v:Person {
        name: 'Alex',
        age: 27,
        occupation: 'Graphic Designer',
        interests: []
    })
    RETURN v
$$) as (v agtype);

How can I add more strings to this property with another query?

cybersam
  • 63,203
  • 6
  • 53
  • 76
Matheus Farias
  • 716
  • 1
  • 10

1 Answers1

1

You can use this code:

SELECT * FROM cypher('DatingApp', $$
    MATCH (v:Person { name: 'Alex' }) 
    SET v.interests = v.interests + ['soccer', 'car racing']
    $$) as (v agtype);

Please note that this operation does not check whether the data being appended already exists in the array.

Wendel
  • 763
  • 1
  • 12