Bolty.ResponseEncoder.Json.Jason (Bolty v0.0.12)

Copy Markdown

A default implementation for Jason encoding library.

More info about Jason: https://hex.pm/packages/jason

Allow this usage:

{:ok, conn} = Bolty.start_link(uri: "bolt://localhost:7687", auth: [username: "neo4j", password: "..."])
{:ok, res} = Bolty.query(conn, "MATCH (t:TestNode) RETURN t")
Jason.encode!(res)

Default implementation can be overriden by providing your own implementation.

More info about implementation: https://hexdocs.pm/jason/readme.html#differences-to-poison

Note:

In order to benefit from Bolty.ResponseEncoder implementation, use Bolty.ResponseEncoder.Json.encode and pass the result to the Jason encoding functions.