cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

mrksph
Node Clone

Hi there,

While I was reworking a cypher snippet I'm working on, I came upon this problem:

These two queries that at first should return the same results, does not!

My :CustomHierarchy node has a lastPCode property which is a String list (e.g.: ["ABCDE"] )

The first one

MATCH (n:CustomHierarchy)
WHERE n.lastPCode IN ["1SULG"]
RETURN n 
LIMIT 25

The second one

MATCH (n:CustomHierarchy {lastPCode: ["1SULG"]}) 
RETURN n 
LIMIT 25

The only difference there is the WHERE clause location... It should yield the same result yet it doesn't...

Anyone knows why?

Comments
Cobra
Ninja
Ninja

Hello @mrksph

lastPCode is a list so you must replace IN by =.

Regards,
Cobra

mrksph
Node Clone

Thanks Cobra, almost two years using Cypher and still forget the basics....

Version history
Last update:
‎06-14-2021 08:07 AM
Updated by:
Contributors