benoitc / couchbeam

Apache CouchDB client in Erlang
Other
242 stars 113 forks source link

Lookup Document's Revision #47

Closed jamesaimonetti closed 13 years ago

jamesaimonetti commented 13 years ago

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_)

benoitc commented 13 years ago

looks good, any chance you could add a test ? Would make the integration easier.

jamesaimonetti commented 13 years ago

added a test in 004-document.t

benoitc commented 13 years ago

applied in 38a14835216a4fa5504cba416f17950a41ebc2db thanks!