Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-29-2020 03:30 PM
def _query_by_cypher(tx, query):
print('{}'.format(query))
results = tx.run(query)
Let's say I want a function to accept users' any cypher string as arguments, and return results. I know normally in order to access data from the "resutls" variable, I need to know some key so that I can do:
[record['count'] for record in results]
But in this case, I have no idea of any possible 'key' that may be used in the 'RETURN ... AS ...' pattern. Is there still a way to get back the data from the results variable without knowing any details of the cypher query beforehand?
11-03-2020 05:45 AM
Hello @lingvisa
You can use index (0, 1, 2, etc.) if you don't know the keys.
results[0]
Regards,
Cobra
All the sessions of the conference are now available online