node-neo4j
node-neo4j copied to clipboard
Params doesn't seem to work when passing inside WHERE query
Hi, when I query using attribute filter, it'll work fine. For example:
const query = [
'MATCH (user:User {email: {email}})',
'RETURN user'
].join('\n')
const params = {
email: '[email protected]' // assume email exists
}
But when I passed inside WHERE statement, it doesn't seem to work:
const query = [
'MATCH (user:User)',
'WHERE email = {email}',
'RETURN user'
].join('\n')
const params = {
email: '[email protected]' // assume email exists
}
I needed this because I need to create query to find node by id. At the moment, my workaround is to concat directly to the query, which is not recommended:
const query = [
'MATCH (user:User)',
'WHERE id(user) = ' + id,
'RETURN user'
].join('\n')
Just wondering is this behavior expected? Because I read the documentation this should be supported. Refer: http://neo4j.com/docs/developer-manual/current/cypher/syntax/parameters/