Search code examples
memgraphdb

How to set more that one node property using Cypher in Memgraph?


When I want to set a node property value, I use

MATCH (c:City)
WHERE c.name = 'London'
SET c.population = 8900000
RETURN c;

How can I set more than one property within code block?


Solution

  • To set more than one property divide the properties with coma, like this:

    MATCH (c:City)
    WHERE c.name = 'London'
    SET c.population = 8900000, c.country = 'United Kingdom'
    RETURN c;