neo4j-rest-client
neo4j-rest-client copied to clipboard
Error using Cypher to get by id
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
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
.