Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged in new util.transform() features from thingdom/node-neo4j-deve…

…lop, worked in

to return functionality with .execute(), tests still passing although they may need flushed
out a bit more thoroughly.
  • Loading branch information...
commit 3e374b75aec0d9b8b6afe1a3bbe288860109d0e2 1 parent 812e013
Stephen Rivas JR authored
Showing with 10 additions and 10 deletions.
  1. +9 −10 lib/GraphDatabase._coffee
  2. +1 −0  test/gremlin._coffee
View
19 lib/GraphDatabase._coffee
@@ -275,16 +275,15 @@ module.exports = class GraphDatabase
# Success: build result maps, and transform nodes/relationships
body = response.body # JSON already parsed by request
- #results = for row in body
- # for value, i in row
- # if value and typeof value is 'object' and value.self
- # if value.type then new Relationship this, value
- # else new Node this, value
- # else
- # value
- # row
-
- return body
+
+ if body instanceof Array
+ results = for row in body
+ map = util.transform row, this
+ map
+ else
+ results = util.transform body, this
+
+ return results
catch error
throw adjustError error
View
1  test/gremlin._coffee
@@ -78,6 +78,7 @@ assert.ok typeof traversals[0][0], 'object'
assert.ok traversals[0][1] instanceof Array
assert.ok typeof traversals[0][2], 'number'
+console.log 'Multiple data types appear to have worked with .execute() and util.transform()'
# ensure you can call without params
Please sign in to comment.
Something went wrong with that request. Please try again.