didier

didier

Bolt.Sips problem with Neo4j

Hi there!

I have a problem with Bolt.Sips and Phoenix. I configured my phoenix app for Bolt as explained in the github page of Bolt.sips but I have the following error while invoking Bolt.Sips.conn : (MatchError) no match of right hand side value:

It’s like the config file is not taken into account. I don’t understand what’s happening. If someone can help me, it would be fantastic! :wink:

Here is my mix.ex file :

def application do
    [mod: {ElmDbz, []},
     applications: [:phoenix, :phoenix_html, :bolt_sips, :cowboy, :logger, :gettext]]
  end

defp deps do
    [{:phoenix, "~> 1.1.6"},
     {:phoenix_html, "~> 2.4"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.9"},
     {:cowboy, "~> 1.0"},
     {:bolt_sips, "~>0.1"},
     {:boltex, github: "florinpatrascu/boltex"}]
  end

And the config.ex file :

config :bolt_sips, Bolt,
  hostname: 'localhost',
  basic_auth: [username: "neo4j", password: "***"]

And the controller :

defmodule ElmDbz.CharacterController do
  use ElmDbz.Web, :controller

  alias Bolt.Sips, as: Bolt

  def index(conn, _params) do
    cypher = """
      MATCH (p:Person) RETURN p as character
    """

    data = Bolt.query!(Bolt.conn, cypher)
    render(conn, "index.json", characters: data)
  end

end

First Post!

NobbZ

NobbZ

Is it a typo or is your config file called config.ex? It should be config.exs.

Also I do not know how the engine does handle the newlines before and after your query, please try to use a single-double-quoted string instead.

PS: I never used that package nor do I even know what it does, nor did I use neo4j.

Last Post!

NobbZ

NobbZ

First thing I stumble upon is starting the worker in the supervisor via worker(Bolt.Sips, [Application.get_env(:bolt_sips, Bolt)]), he does read the configuration manually and pass it to the worker.

You are not showing how you do handle your supervisor, so I assume you are not even having the worker in your supervision tree.

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement