I want to update some of my records in the neo4j DB. In order that I wrote this query in Neo4jClient in C#:
_client.Cypher
.Unwind(skills, "updatedSkill")
.Match("(s : Skill {Name: updatedSkill.Name}")
.Set("s = updatedSkill");
.ExecuteWithoutResults();
Where skills is a simple list of Skill objects:
public class Skill
{
public string Name { get; set; }
public string Phrase { get; set; }
}
But this code throws exception when I call it. Its translated Cypher query is:
UNWIND [{
"Name": "name1",
"Phrase": "phrase1",
},{
"Name": "name2",
"Phrase": "phrase2",
}] AS updatedSkill
MATCH (s : Skill {Name: updatedSkill.Name}
SET s = updatedSkill
The exception is as follows:
Invalid input '"': expected whitespace, comment, an identifier,
UnsignedDecimalInteger, a property key name or '}' (line 3, column 5 (offset: 17))
" "Name": "name1","
^
When I remove the double-quotes of the properties Name and Phrase the query runs correctly. But I can do it because the query is auto-generated by Neo4jClient.
Any ideas?