summaryrefslogtreecommitdiff
path: root/src/fabric.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-05-28 10:47:42 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-05-28 10:47:42 -0400
commitffb5e5579a443b9c729ad52b8806dc2b83d51588 (patch)
tree5a59ce4614fea6a6ea84b7a8a931ba2d2880e70a /src/fabric.erl
parenta0823f1861d2b571537f75b151e936824dac068b (diff)
add update_doc
Diffstat (limited to 'src/fabric.erl')
-rw-r--r--src/fabric.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fabric.erl b/src/fabric.erl
index e0ffe16b..3a4575bd 100644
--- a/src/fabric.erl
+++ b/src/fabric.erl
@@ -1,8 +1,8 @@
-module(fabric).
-export([all_databases/1, create_db/2, delete_db/2, get_db_info/2,
- db_path/2]).
--export([open_doc/3, open_revs/4, update_docs/3]).
+ db_path/2]).
+-export([open_doc/3, open_revs/4, update_doc/3, update_docs/3]).
-include("../../couch/src/couch_db.hrl").
@@ -34,6 +34,10 @@ open_doc(DbName, Id, Options) ->
open_revs(DbName, Id, Revs, Options) ->
fabric_doc:open_revs(dbname(DbName), docid(Id), Revs, Options).
+update_doc(DbName, Doc, Options) ->
+ {ok, [Result]} = update_docs(DbName, [Doc], Options),
+ Result.
+
update_docs(DbName, Docs, Options) ->
fabric_doc:update_docs(dbname(DbName), docs(Docs), Options).
@@ -56,10 +60,6 @@ docid(DocId) ->
docs(Docs) when is_list(Docs) ->
[doc(D) || D <- Docs];
-docs(#doc{} = Doc) ->
- [Doc];
-docs({_} = Doc) ->
- [couch_doc:from_json_obj(Doc)];
docs(Docs) ->
erlang:error({illegal_docs_list, Docs}).