Modeled after doc_exists/2, this pulls the etag from the headers returned from the head request and returns it. CouchDB (1.0.2) returns the revision with escaped quotation marks ( "\"1-blah1234\""); I wasn't sure whether to strip them or just document the return type (does it vary with couch versions?). So that may need changing.
Also updated couchbeam_util:get_value/2,3 to model the quirks of proplists:get_value/2,3 and to use lists:keyfind/3 instead of lists:keysearch/3 as per the lists docs.
Modeled after doc_exists/2, this pulls the etag from the headers returned from the head request and returns it. CouchDB (1.0.2) returns the revision with escaped quotation marks ( "\"1-blah1234\""); I wasn't sure whether to strip them or just document the return type (does it vary with couch versions?). So that may need changing.
Also updated couchbeam_util:get_value/2,3 to model the quirks of proplists:get_value/2,3 and to use lists:keyfind/3 instead of lists:keysearch/3 as per the lists docs.
Hope either (or both) is helpful,
James (mc_)