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

Error using Cypher to get by id #136

Open
njss opened this issue Jul 15, 2017 · 1 comment
Open

Error using Cypher to get by id #136

njss opened this issue Jul 15, 2017 · 1 comment

Comments

@njss
Copy link

njss commented Jul 15, 2017

I allways receive an error in pytho n(spyder) executing this:

q = "match (u:User {id:1})-[:OWN]->()<-[:OWN]-(other) return other.name, count() order by count() desc limit 5"
results = db.query(q, returns=(client.Node, str, client.Node))

ERROR

File "C:\Anaconda3\lib\site-packages\neo4jrestclient\query.py", line 714, in cast_element
obj = func(element["self"], update_dict=element,

TypeError: string indices must be integers

@versae
Copy link
Owner

versae commented Aug 7, 2017

You need your returns=(client.Node, str, client.Node) to match the RETURN clause of your Cypher query. If the Cypher query is only returning 2 elements, a string and a number, you need to pass that to the returns.

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