0
votes

I’m using Neo4j Release 2 with Java SE 7. I’ve reviewed the online C# client examples and still have not been able to accomplish this simple task. Below is my code snippet that most closely follows syntax from examples post here: (https://github.com/Readify/Neo4jClient/wiki/cypher-examples).

My problem is that the query always come back with a count of zero.
In this example, I am trying to test if the node Person with a Name property equal to “Beth” has already been created as a node in my database. In this case I know the node exists as I can query for Beth using Cypher via Neo4j's web browser client.

The var query always come back with a count of zero elements. Why?

string myname = "Beth";
var query = client.Cypher
  .Match("(person:Person)")
  .Where((Person person) => person.Name == myname)
  .Return(person => person.As<Person>())
  .Results;

Console.WriteLine(query.Count());    // returns 0  
1

1 Answers

0
votes

There has to be something slightly different between the two queries you are using.

Follow the debugging instructions at https://github.com/Readify/Neo4jClient/wiki/cypher#debugging to diagnose the difference and then react accordingly.

There is not enough information in your question for me to give you a better answer, especially as you haven't said what query you are using in the web console.

Also, if you're only just transitioning into C# for the first time with Neo4j, then remember that property names are case sensitive. If you created your node in the web console with a name property, you'll never find it using Name in your C# definition.