Using MongoDB with Chicago Boss

57 Views Asked by At

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.

1

There are 1 best solutions below

0
zoro On
  • 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}.