mschae / boltex

Elixir driver for the neo4j bolt protocol
Other
29 stars 6 forks source link

Not a PackStream.decode issue apparently, however ... #2

Closed florinpatrascu closed 8 years ago

florinpatrascu commented 8 years ago

This Cypher: "RETURN 10 as num", is returned like this:

[success: %{"fields" => ["num"]}, record: '\n', success: %{"type" => "r"}]

However, PackStream.decode(<<0xA>>) is correctly returning 10

mschae commented 8 years ago

Hey @florinpatrascu,

This is working correctly and just Elixir trying its best to format the output. record is a list of fields, in this case [10]. Elixir interprets that as a charlist, so [10] becomes '\n'.

$ iex
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (1.3.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> '\n' == [10]
true