Skip to content

Commit

Permalink
Add support for update functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Kirk committed Jul 8, 2016
1 parent bbfdeb8 commit d2faca9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Clutch is a [Clojure](http://clojure.org) library for [Apache CouchDB](http://co
To include Clutch in your project, simply add the following to your `project.clj` dependencies:

```clojure
[com.ashafa/clutch "0.4.0"]
[com.ashafa/clutch "0.4.1"]
```

Or, if you're using Maven, add this dependency to your `pom.xml`:
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject com.ashafa/clutch "0.4.0"
(defproject com.ashafa/clutch "0.4.1"
:description "A Clojure library for Apache CouchDB."
:url "https://github.com/clojure-clutch/clutch/"
:license {:name "BSD"
Expand Down
7 changes: 7 additions & 0 deletions src/com/ashafa/clutch.clj
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@
(utils/url attachment-name)
(assoc :as :stream))))))

(defdbop run-update-fn
"Runs a CouchDB update function."
[db design-document update-function-name body & {:keys [id]}]
(couchdb-request (if id :put :post)
(utils/url db "_design" (name design-document) "_update" (name update-function-name) id)
:data body))

;;;; _changes

(defdbop changes
Expand Down

0 comments on commit d2faca9

Please sign in to comment.