Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Minimal Common Lisp interface to Riak

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 cl-riak.asd
Octocat-spinner-32 cl-riak.lisp
Octocat-spinner-32 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.