benoitc / couchbeam

Apache CouchDB client in Erlang
Other
242 stars 114 forks source link

couchbeam_ejson decode broken for nested map values #123

Open iambumblehead opened 9 years ago

iambumblehead commented 9 years ago
> couchbeam_ejson:decode(#{<<"map">> => #{"nestedmap" => "val"}}).
** exception throw: {invalid_json,badarg}
     in function  couchbeam_ejson:decode/1 (src/couchbeam_ejson.erl, line 41)

I use this file as a work-around: https://github.com/iambumblehead/childmaps/blob/master/src/childmaps.erl

The problem manifests for me when trying to persist map data. The error is shown and data is not persisted unless all maps are converted to lists first.

benoitc commented 9 years ago

couchbeam does not yet support maps but only proplists unfortunately. This is planned for the next releae which should happen sometimes this month.