Search code examples
c#neo4jneo4jclient

neo4jclient Expression type Add is not supported


I have two Nodes - Phone and Users. 10000 Phones and 10000 users. I want connect it with relation.Its show me error neo4jclient Expression type Add is not supported

for (int k=1;k<10000;k++)
            {
                client.Cypher
                    .Match("(user1:User)", "(user2:Phone)")
                    .Where((Users user1) => user1.Fio == "Radzhab"+k)
                    .AndWhere((Phone user2) => user2.Name == "33-333"+k)
                    .Create("user1-[:HAVE_PHONE]->user2")
                    .ExecuteWithoutResults();
            }

MATCH (user1:User), (user2:Phone) WHERE user1.Fio = "Radzhab1" AND user2.Name = "33-3331" CREATE user1-[:HAVE_PHONE]->user2; its work correct in console


Solution

  • This looks like a bug in Neo4jClient.

    As a workaround, try this:

    for (var k = 1; k < 10000; k++)
    {
        var fio = "Radzhab"+k;
        var name = "33-333"+k;
        client.Cypher
            .Match("(user1:User)", "(user2:Phone)")
            .Where((Users user1) => user1.Fio == fio)
            .AndWhere((Phone user2) => user2.Name == name)
            .Create("user1-[:HAVE_PHONE]->user2")
            .ExecuteWithoutResults();
    }