0

I'm trying to use this cypher query

MATCH (n:PRODUCT_LOT_1)<-[:SHIPS|CONTAINS*..]-(s:SHIPMENT_1)  
WHERE  n.lot_id IN ['17'] AND 
EXISTS { MATCH (n)<-[:STORES|:HAS|:CONTAINS*..]-(loc:STORAGE_AREA_1) 
         WHERE loc.uuid IN ['d3177e9c-ddd0-48f7-8ad8-2209d64383d0','4f3fc27d-92f9-48e0-8446-6d3c2dd7b471']} 
RETURN n.lot_quantity;

but it giving syntax error

Neo.ClientError.Statement.SyntaxError: Invalid input '(': expected whitespace, comment, ':', ',' or '}' (line 1, column 108 (offset: 107))

1 Answer 1

1

Your query is syntactically wrong, in this statement you used MATCH (n)<-[:STORES|:HAS|:CONTAINS*..]-(loc:STORAGE_AREA_1), colon before each relationship type, which is not required try this instead:

MATCH (n:PRODUCT_LOT_1)<-[:SHIPS|CONTAINS*..]-(s:SHIPMENT_1)  
WHERE  n.lot_id IN ['17'] AND 
EXISTS { MATCH (n)<-[:STORES|HAS|CONTAINS*..]-(loc:STORAGE_AREA_1) 
         WHERE loc.uuid IN ['d3177e9c-ddd0-48f7-8ad8-2209d64383d0','4f3fc27d-92f9-48e0-8446-6d3c2dd7b471']} 
RETURN n.lot_quantity;
Sign up to request clarification or add additional context in comments.

1 Comment

the EXISTS + MATCH syntax is correct. It is introduced in version 4. neo4j.com/docs/cypher-manual/4.0/clauses/where

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.