Translate CouchDB document update handler to erlang
I have some problems to translate the Javascript Document Update Handler
to Erlang, because I can´t find any examples on google, CouchDB Markmail
or in the Mailing-Lists.
The following example is my Javascript update handler in the design
document of CouchDB:
function(doc,req) {
doc.description = req.form.description;
doc.owner = req.form.owner;
var message = "Update document successfull!";
return [doc, message];
}
but how to translate this update function into Erlang for CouchDB ? Maybe
something like:
fun({Doc}, {Req}) ->
FormValues = couch_util:get_values(<<"form">>, Req)
.......
end.
Thank you for any ideas!
Michael
No comments:
Post a Comment