Skip to content

Latest commit

 

History

History
187 lines (115 loc) · 5.56 KB

couchbeam_doc.md

File metadata and controls

187 lines (115 loc) · 5.56 KB

Module couchbeam_doc

Data Types


key_val() = lis() | binary()

property() = json_obj() | tuple()

Function Index

delete_value/2Deletes all entries associated with Key in json object.
extend/2extend a jsonobject by a property, list of property or another jsonobject.
extend/3extend a jsonobject by key, value.
get_id/1get document id.
get_idrev/1get a tuple containing docucment id and revision.
get_rev/1get document revision.
get_value/2Returns the value of a simple key/value property in json object Equivalent to get_value(Key, JsonObj, undefined).
get_value/3Returns the value of a simple key/value property in json object function from erlang_couchdb.
is_saved/1If document have been saved (revision is defined) return true, else, return false.
set_value/3set a value for a key in jsonobj.
take_value/2Returns the value of a simple key/value property in json object and deletes it form json object Equivalent to take_value(Key, JsonObj, undefined).
take_value/3Returns the value of a simple key/value property in json object and deletes it from json object.

Function Details

delete_value/2


delete_value(Key::key_val(), JsonObj::json_obj()) -> json_obj()

Deletes all entries associated with Key in json object.

extend/2


extend(Prop::property(), JsonObj::json_obj()) -> json_obj()

extend a jsonobject by a property, list of property or another jsonobject

extend/3


extend(Key::binary(), Value::json_term(), JsonObj::json_obj()) -> json_obj()

extend a jsonobject by key, value

get_id/1


get_id(Doc::json_obj()) -> binary()

get document id.

get_idrev/1


get_idrev(Doc::json_obj()) -> {DocId, DocRev}

get a tuple containing docucment id and revision.

get_rev/1


get_rev(Doc::json_obj()) -> binary()

get document revision.

get_value/2


get_value(Key::key_val(), JsonObj::json_obj()) -> term()

Returns the value of a simple key/value property in json object Equivalent to get_value(Key, JsonObj, undefined).

get_value/3


get_value(Key::lis() | binary(), JsonObj::json_obj(), Default::term()) -> term()

Returns the value of a simple key/value property in json object function from erlang_couchdb

is_saved/1


is_saved(Doc::json_obj()) -> boolean()

If document have been saved (revision is defined) return true, else, return false.

set_value/3


set_value(Key::key_val(), Value::term(), JsonObj::json_obj()) -> term()

set a value for a key in jsonobj. If key exists it will be updated.

take_value/2


take_value(Key::key_val(), JsonObj::json_obj()) -> {term(), json_obj()}

Returns the value of a simple key/value property in json object and deletes it form json object Equivalent to take_value(Key, JsonObj, undefined).

take_value/3


take_value(Key::key_val() | binary(), JsonObj::json_obj(), Default::term()) -> {term(), json_obj()}

Returns the value of a simple key/value property in json object and deletes it from json object