I wanted to create relationships between two places after doing unwind. The code looks something like this:
// Create a place
UNWIND [
{place: 'Westmere'},
{place: 'Ponsonby'},
{place: 'Greylynn'},
{place: 'Eden Terrace'},
{place: 'Auckland Central'},
{place: 'Parnell'},
{place: 'New Market'}
] AS row CREATE (toLower(replace(row.place, ' ', '')):Place {name: row.place});
CREATE (westmere)-[c:CONNECTS]->(ponsonby)
SET c.weight = 10;
CREATE (westmere)-[c:CONNECTS]->(greylynn)
SET c.weight = 50;
CREATE (westmere)-[c:CONNECTS]->(edenterrace)
SET c.weight = 30;
CREATE (ponsonby)-[c:CONNECTS]->(aucklandcentral)
SET c.weight = 10;
CREATE (ponsonby)-[c:CONNECTS]->(greylynn)
SET c.weight = 60;
CREATE (ponsonby)-[c:CONNECTS]->(edenterrace)
SET c.weight = 120;
CREATE (aucklandcentral)-[c:CONNECTS]->(parnell)
SET c.weight = 8;
CREATE (aucklandcentral)-[c:CONNECTS]->(newmarket)
SET c.weight = 62;
CREATE (parnell)-[c:CONNECTS]->(newmarket)
SET c.weight = 45;
I get an error as:
Invalid input 'toLower': expected "(", "allShortestPaths" or "shortestPath" (line 10, column 18 (offset: 231))
"] AS row CREATE (toLower(replace(row.place, ' ', '')):Place {name: row.place});"
I am not too sure what I am doing wrong here, shouldn't the text first remove any space and then lower the text?