philippkueng / node-neo4j

Neo4j REST API wrapper for Node.js
MIT License
211 stars 44 forks source link

Better handling of cypher query results #49

Open DenysVuika opened 9 years ago

DenysVuika commented 9 years ago

Right now when 'cypherQuery' call results in a multi-dimensional array that requires knowing all positions of the data in the result set. For example when executing "[...] RETURN user, roles" I would ideally expect accessing data in the callback via some getters, similar to the following: "result.data[0].user" or "result.data[1].roles" without the need using "result.columns" for that. This should greatly simplify scenarios related to raw cypher query calls.

philippkueng commented 9 years ago

Hi @DenisVuyka

Generally I tried keeping it as close to the original response from Neo4j since I didn't know how they develop their language. It's a good idea though; will investigate on how that can be implemented without breaking backwards compatibility.