Skip to content
Minimal Common Lisp interface to Riak
Common Lisp
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE
README.md
cl-riak.asd
cl-riak.lisp
package.lisp

README.md

Basic usage

Set

(cl-riak:set key value :bucket "bucket-name")

* (cl-riak:set "foo" "bar" :bucket "nom") 

"bar"
"a85hYGBgzGDKBVIcypz/fvql33qYwZTImMfK8CHsznG+LAA="

Get

(cl-riak:get key value :bucket "bucket-name")

* (cl-riak:get "foo" :bucket "nom")

"bar"
"a85hYGBgzGDKBVIcypz/fvql33qYwZTImMfK8CHsznG+LAA="

MapReduce

(yes, this is ugly)

An example: (define-constant +mapred-reminders+ "{ \"inputs\":\"reminder\", \"query\":[ { \"map\":{ \"language\":\"javascript\", \"source\":\"function (v, k, a) {var data = Riak.mapValuesJson(v)[0]; if (data.username == '~a') {return [{'key':v.key, 'value':v.values[0].data}];} else {return [];}}\", \"keep\":true } } ] }" :test 'string=)

(let ((reminders (cl-riak:mapred (format nil +mapred-reminders+ username))))
     ...)
Something went wrong with that request. Please try again.