Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなタプルのリストを返す mnesia のクエリがあります。
[{"str", 10}, {"str2", 20}]
を使用してjsonに変換したいのですが、できないようですjiffy。jiffy:encode/1とにかく私の問題を解決する方法はありますか?!
jiffy
jiffy:encode/1
私はあなたが何を期待しているのか理解できませんが、最初に正しいデータ形式を提供する必要があります:
1> L = [{"str", 10}, {"str2", 20}]. [{"str",10},{"str2",20}] 2> jiffy:encode({[{list_to_binary(K), V} || {K, V} <- L]}). <<"{\"str\":10,\"str2\":20}">>