Skip to content

Commit

Permalink
Merged in new util.transform() features from thingdom/node-neo4j-deve…
Browse files Browse the repository at this point in the history
…lop, worked in

to return functionality with .execute(), tests still passing although they may need flushed
out a bit more thoroughly.
  • Loading branch information
Stephen Rivas JR committed Sep 14, 2012
1 parent 812e013 commit 3e374b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/GraphDatabase._coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/gremlin._coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3e374b7

Please sign in to comment.