I am trying to write Erlang list functions in CouchDB, however I am not familiar with returned data types and how to manage them. I would like someone to show me how to translate the simple Javascript List function below into the Erlang list function. That would be a good moment for me.
function(head, req) { var row,resp={},data=[]; if(head){ resp["total_rows"] = head.total_rows; } while(row = getRow()) { data.push(row); } resp.rows = data; return JSON.stringify(resp); }
Thanks in advance.
Fortu source share