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

how do I pass a string for the relationship in a query? #222

Closed
angelacode opened this issue May 17, 2017 · 2 comments
Closed

how do I pass a string for the relationship in a query? #222

angelacode opened this issue May 17, 2017 · 2 comments

Comments

@angelacode
Copy link

Neography::SyntaxException: Parameter maps cannot be used in MATCH patterns (use a literal map instead, eg. "{id: {param}.id}") (line 1, column 21 (offset: 20))
"MATCH (fromNode)-[{relationship}]->(toNode) "

My match statement has an error, even though I pass the value to the relationship string:

query_response = @neo.execute_query("MATCH (fromNode)-[{relationship}]->(toNode)
WHERE fromNode.bot_client_id = {bot_client_id} AND toNode.epoch_utc_i > {fromTime} AND toNode.epoch_utc_i < {toTime}

                                        RETURN  toNode.value
                                        LIMIT   {limit}", 
                                        {
                                            :fromTime => fromTime, :toTime => toTime, :bot_client_id => @bot_client_id, 
                                            :limit => limit, :relationship => relationship.to_sym
                                        }
                                    )
@maxdemarzi
Copy link
Owner

@neo.execute_query("MATCH (fromNode)-[:" +relationship + "]->(toNode)
WHERE fromNode.bot_client_id = {bot_client_id} AND toNode.epoch_utc_i > {fromTime} AND toNode.epoch_utc_i < {toTime}"

@maxdemarzi
Copy link
Owner

You can't use a parameter for a relationship type.

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