0

I'm a newbie to Erlang and I'm using Chicago Boss for a small web project. I have had no issues working with the in-memory db but when I configured it to use mongodb it doesn't go quite as expected. Below is my boss.config database section.

{db_host, "127.0.0.1"},
    {db_port, 27017 },
    {db_adapter, mongodb},
%    {db_username, "boss"},
%    {db_password, "boss"},
    {db_database, "asm_dashboard"},

I have made sure mongodb is running. I have tried installing mongodb-erlang(https://github.com/comtihon/mongodb-erlang) both manually and using rebar but I still end up with the same exception:

[error] gen_server <0.182.0> terminated with reason: {'module could not be loaded',[{mongo,connect,[{"127.0.0.1",27017}],[]}

Please assist.

Wedava
  • 1,211
  • 2
  • 16
  • 30
  • Is `mongodb` added to the application list in your app.src file? – Máté Feb 06 '18 at 07:58
  • @matov yes. It looks like this: {application, asm_dashboard, [ {description, "My Awesome Web Framework"}, {vsn, "0.0.1"}, {modules, []}, {registered, []}, {applications, [kernel, stdlib, crypto, mongodb]}, {env, []} ]}. – Wedava Feb 08 '18 at 09:11

1 Answers1

0
  • First, can you post your whole boss.config file ?
  • Try this template of mysql DB, I think it is the same, but it should be declared at etc/web.conf
%% Mysql DB Config of ChicagoBoss
{db_schema, "your_db_name"}.
{db_username, "boss"}.
{db_password, "boss"}.
{dp_ip, "127.0.0.1"}.
{db_port, 27017 }.
{pool_size, 10}.
zoro
  • 333
  • 3
  • 13