couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "GettingStartedWithLisp" by PeterEddy
Date Sat, 12 Apr 2008 12:26:53 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by PeterEddy:

New page:
Getting started with Lisp and the CouchDB API.

== Library ==

The code for Clouchdb, the Lisp CouchDB library, can be obtained from:

This library can be installed with ASDF:

CL-USER> (asdf-install:install 'clouchdb)
CL-USER> (asdf:oos 'asdf:load-op '#clouchdb)

== Using the Library ==

;; Create a workspace package
(defpackage :clouchdb-user (:use :cl :clouchdb :parenscript))
(in-package :clouchdb-user)

;; See what databases exist on default connection, which is 
;; host "localhost", port 5984

;; Create database "myDb"
(set-connection :db-name "myDb")

;; Create a document in database "myDb"
(create-document '((:Subject . "I like Plankton")
                   (:Author . "Rusty")
                   (:PostedDate . "2006-08-15T17:30:12-04:00")"
                   (:Tags . ("plankton" "baseball" "decisions"))
                  :id "myDoc")

;; Get all documents in "myDb"

;; Get document "myDoc"
(get-document "myDoc")

;; Delete document "myDoc"
(delete-document :id "myDoc")

;; List information about database "myDb"
(get-db-info :db-name "myDb")

View raw message