0
votes

I have a graph in neo4j with 100 million nodes. I created an unique constraint on a property but when I use the property in my where clause it returns no rows. I know it has a result but returns no rows.
my Cypher query is like below:

MATCH(n:Person{PK:'1'})
RETURN n

or

MATCH(n:Person)
WHERE n.PK='1'
RETURN n
2
Maybe a String/Integer problem? Does MATCH (n:Person {PK:1}) work?Martin Preusse
Perhaps you could share some more detail, such as the results of :schema in the browser? What cypher did you use to create the constraint? What is the node data that you believe should match the index?ceej
Can you show us a few Person nodes? What does this return? MATCH (n:Person) RETURN n LIMIT 5;cybersam

2 Answers

0
votes

Can you try to use :schema in the browser to check your constraint?

Also note that it is case sensitive, both for the label and the key.

0
votes

Just because you have a unique constraint doesn't mean that you have data, in this case a person, with that property. Try just pulling up a person and seeing what properties are set.

match (p:Person) return p limit 5;

My suspicion is that the problem is in how you are creating the Person nodes. Can you share that code with us?