Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Params doesn't seem to work when passing inside WHERE query #215

Open
nabilzhafri opened this issue Feb 28, 2017 · 0 comments
Open

Params doesn't seem to work when passing inside WHERE query #215

nabilzhafri opened this issue Feb 28, 2017 · 0 comments

Comments

@nabilzhafri
Copy link

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: 'user@example.com' // 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: 'user@example.com' // 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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant