Search code examples
neo4jspecial-charactersbackticks

Escaping Special Characters in Import for Neo4j


In my where clause I am trying to escape a special character "#" by following the manual's recommendation regarding backticks when creating a node:

WHERE line.`The #` IS NOT NULL AND line.`Person's First/Last Name` IS NOT NULL

However, when I do this, I get message:

No data returned, and nothing was changed.

Am I escaping the header values ("The #" and "Person's First/Last Name") properly?


Solution

  • This example code works for me, doesn't look like your problem is the escape characters.

    CREATE (n:TestNode { `The #`:"123", `Person's First/Last Name`:"john johnson" });
    
    MATCH (line)
    WHERE line.`The #` IS NOT NULL AND line.`Person's First/Last Name` IS NOT NULL
    RETURN line.`The #`, line.`Person's First/Last Name`;
    
    line.`The #`    line.`Person's First/Last Name`
    123 john johnson
    Returned 1 row in 128 ms