Why these query does not return the same result?

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?

Hello @mrksph :slight_smile:

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

Regards,
Cobra

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

1 Like