Skip to content

Syntax for neo4j v5 (deprecation) #36

Open
@nrouyer

Description

@nrouyer

In Neo4j 5.9, creating a node or relationship entity, and then referencing that entity in a property definition in the same CREATE clause is deprecated. Split the CREATE clause into two separate clauses instead.

As a consequence, in the racks section, instead of:

// Racks
WITH 10 as racks
MATCH (dc:DataCenter {name:"DC1"})
MATCH (nr:Network:Zone) // one per zone
WITH * UNWIND range(1,racks) AS rackid
CREATE (dc)-[:CONTAINS]->(rack:Rack {name:"DC1-RCK-"+nr.zone+"-"+rackid, rack:rackid, zone:nr.zone})-[:HOLDS]->(s:Switch {ip:nr.ip+"."+rackid, rack:rackid})-[:ROUTES]->(si:Interface {ip:s.ip+".254"})<-[:ROUTES]-(nr);

We should now have:

// Racks
WITH 10 as racks
MATCH (dc:DataCenter {name:"DC1"})
MATCH (nr:Network:Zone) // one per zone
WITH * UNWIND range(1,racks) AS rackid
CREATE (rack:Rack {name:"DC1-RCK-"+nr.zone+"-"+rackid, rack:rackid, zone:nr.zone})
CREATE (s:Switch {ip:nr.ip+"."+rackid, rack:rackid})
CREATE (si:Interface {ip:s.ip+".254"})
CREATE (dc)-[:CONTAINS]->(rack)-[:HOLDS]->(s)-[:ROUTES]->(si)<-[:ROUTES]-(nr);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions