Module couchdb_attachments


Function Index

delete/3delete a document attachment.
delete/4delete a document attachment.
fetch/3fetch a document attachment.
fetch/4
put/4put an attachment.
put/5put an attachment.
send/2send an attachment chunk Msg could be Data, eof to stop sending.
stream/1fetch an attachment chunk.

Function Details

delete/3

delete(Db, Doc, Name) -> any()

Equivalent to delete(Db, Doc, Name, []).

delete a document attachment

delete/4

delete(Db, DocOrDocId, Name, Options) -> any()

delete a document attachment

fetch/3

fetch(Db, DocId, Name) -> any()

Equivalent to fetch(Db, DocId, Name, []).

fetch a document attachment

fetch/4

fetch(Db::db(), DocId::string(), Name::string(), Options0::list()) -> {ok, binary()} | {ok, atom()} | {error, term()}

put/4

put(Db, Document, Name, Body) -> any()

Equivalent to put(Db, Document, Name, Body, []).

put an attachment

put/5

put(Db::db(), Document::map(), Name::binary(), Body::binary(), Options::list()) -> {ok, term()}

put an attachment

Body::body(), Option::optionList()) -> {ok, iolist()} optionList() = [option()] option() = {rev, string()} | {content_type, string()} | {content_length, string()} body() = [] | string() | binary() | fun_arity_0() | {fun_arity_1(), initial_state(), stream} initial_state() = term()

send/2

send(Ref, Msg) -> any()

send an attachment chunk Msg could be Data, eof to stop sending.

stream/1

stream(Ref::atom()) -> {ok, binary()} | done | {error, term()}

fetch an attachment chunk. Use this function when you pass the stream option to the couchdb:fetch/4 function. This function return the following response:

done
You got all the attachment
{ok, binary()}
Part of the attachment
{error, term()}
n error occurred


erlang logo

Made with EDoc-S