Hi
I have a Java Maven Spring Boot project, that fetches data from multiple Neo4j Nodes to output these values using a GET Restful API. However, one of my scenarios requires me to use the 'status=Active' in my relationship to decide which node data should be displayed, but I cannot get this to work.
The model is as follows:
(ProductOffering)-[SERVICE_CANDIDATE]-> (ServiceCandidateRef)
The relationship SERVICE_CANDIDATE contains a field called 'status' that can have the value of Active or Inactive.
Can anyone guide me on how to resolve this?
thanks in advance.
Pete
You would do something like the following:
Match (p:ProductOffering{key:$key})
Match (p)-[:SERVICE_CANDIDATE{status:$status}]->(s:ServiceCandidateRef)
Return p, collect(s) as q
$key and $status are passed as query params. I just used key to represent your unique identifier for lookups. You can also change return values to be more granular if that is what is needed. You can also do that in your client code to transform your data into your domain objects.
You should also have an index on ProductOffering(key).
Can you send your code if this isn’t enough help to get you on the correct track.