Quantcast
Channel: Spring Community Forums - NoSQL
Viewing all articles
Browse latest Browse all 128

Cypher Query help

$
0
0
Though the title may be incorrect, I need help with Spring Data.
I have two entities Policy and City refer to the same NodeEntity 'State' as shown below:

Code:

        State riskState; //from Policy

        @Indexed(indexName="cities", indexType=IndexType.SIMPLE, unique=true)
        String city;
        State state;

The following cypher query returns me all the policies that belong to the State 'FL'
Code:

START n=node:states(code='FL')
match n<-[:riskState]-policy
RETURN policy.policyNumber;

My understanding is that the relationship name is obtained from the property name - 'riskState' in Policy entity.
If I apply the same logic for City, the following query did not return any data though I could see the relationships in the Data Browser.
Code:

START n=node:states(code='FL')
match n<-[:state]-city
RETURN city;

Could you please explain the reason?
Thanks

Viewing all articles
Browse latest Browse all 128

Trending Articles