Exclamation mark is obsolete syntax - maybe prefix with `CYPHER 1.9` or use `has(n.foo) AND n.foo = {foo}` which should work in both versions.