neo4j-rest-client icon indicating copy to clipboard operation
neo4j-rest-client copied to clipboard

Error using Cypher to get by id

Open njss opened this issue 7 years ago • 1 comments

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

njss avatar Jul 15 '17 00:07 njss

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.

versae avatar Aug 07 '17 21:08 versae