0

I have code like this:

index('GET', []) ->
    Users = boss_db:find(consumer, []),
    {json, [{"users", Users}]}.

And I have an error:

{function_clause,
    [{boss_json,json_data1,
         [[{consumer,"consumer-52a3024b4346e12118000001",<<"qwe">>,
               <<"qwe">>},
           {consumer,"consumer-52a302c84346e12118000002",<<"asd">>,
               <<"asd">>},
           {consumer,"consumer-52a305264346e12118000003",<<"zxc">>,
               <<"zxc">>}],
          ["user"],
          []],
         [{file,"src/boss/boss_json.erl"},{line,23}]}

Where is the problem? How to solve it?

cnaize
  • 3,139
  • 5
  • 27
  • 45

1 Answers1

1

Probably a mistake in the last line, users must be an atom, not a string:

 {json, [{users, Users}]}.
P_A
  • 1,804
  • 1
  • 19
  • 33