Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-01-2022 03:48 AM
I am new to Cypher query , I am trying to fetch the details of a product which does not have a relationship attached to it. I am attaching the image of the graph query and giving it a red border along with the error it throws.
Solved! Go to Solution.
11-01-2022 07:52 AM
You don't have a full match pattern in your 'where' clause. I will assume you don't want the 'product' not to be related to any node via an the listed relationship types. Try this:
match (n:SHIPMENT{uuid: 'replace with uuid'})-[:SHIPS]->(product:PRODUCT_LOT_1)
where not exists ( (product)-[:ADJUST|PICKS|WAS_ADJUST]-() )
and product.initial_qty = product.lot_quantity
return product.uuid as product_uuid
11-01-2022 07:52 AM
You don't have a full match pattern in your 'where' clause. I will assume you don't want the 'product' not to be related to any node via an the listed relationship types. Try this:
match (n:SHIPMENT{uuid: 'replace with uuid'})-[:SHIPS]->(product:PRODUCT_LOT_1)
where not exists ( (product)-[:ADJUST|PICKS|WAS_ADJUST]-() )
and product.initial_qty = product.lot_quantity
return product.uuid as product_uuid
11-01-2022 10:41 AM
Thanks, it works. But could you please explain why is there a blank () after the relationship tags. What does that blank () signify? @glilienfield
11-01-2022 11:44 AM
It means to match to any node, regardless of labels and properties. I figured that would work in your case since you explicitly specified the relationship types.
All the sessions of the conference are now available online