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

Can't use params in request using "WHERE IN {params}" #11

Open
linko opened this issue May 27, 2013 · 2 comments
Open

Can't use params in request using "WHERE IN {params}" #11

linko opened this issue May 27, 2013 · 2 comments

Comments

@linko
Copy link

linko commented May 27, 2013

Here is an example of query

Keymaker.service.execute_cypher("START n=node:skillindex('*:*') MATCH (n)-[:belongsTo]->(x)<-[:belongsTo]-(y) , n-[:relatedTo*2..2]-y WHERE n.name IN [{names}] RETURN DISTINCT y limit 12", {names: skill_names})

I also tried {names: skill_names.map{|skill| "'#{skill}'"}.join(', ')}), IN [{names}] and just IN {names}

@therubymug
Copy link
Owner

And this query runs fine on the neo4j console?

@linko
Copy link
Author

linko commented Jun 5, 2013

Yes, so I had to do something like this

Keymaker.service.execute_cypher("START n=node:skillindex('*:*') MATCH (n)-[:belongsTo]->(x)<-[:belongsTo]-(y) , n-[:relatedTo*2..2]-y WHERE n.name IN [#{skill_names}] RETURN DISTINCT y limit 12", {})

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

2 participants