Skip to content

Commit

Permalink
Introduce welle.mr
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed May 3, 2012
1 parent 7348ed3 commit 2aa136e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
@@ -1,5 +1,13 @@
## Changes between Welle 1.0.0-alpha3 and 1.0.0-alpha4

### Map/Reduce support: clojurewerkz.welle.mr

Initial map/reduce queries support has been implemented, everything related to it
resides under the new `clojurewerkz.welle.mr` namespace.




### clojurewerkz.welle.kv/fetch-one

`clojurewerkz.welle.kv/fetch-one` is a convenience function for fetching objects in cases where conflicts/siblings are not expected.
Expand Down
15 changes: 15 additions & 0 deletions src/clojure/clojurewerkz/welle/mr.clj
@@ -0,0 +1,15 @@
(ns clojurewerkz.welle.mr
(:require [clojure.data.json :as json])
(:use clojurewerkz.welle.core)
(:import com.basho.riak.client.raw.query.MapReduceSpec))


;;
;; API
;;

(defn map-reduce
"Runs a map/reduce query"
[query]
(let [result (.mapReduce *riak-client* (MapReduceSpec. (json/json-str query)))]
(json/read-json (.getResultRaw result))))

0 comments on commit 2aa136e

Please sign in to comment.