[clouchdb-cvs] CVS clouchdb/src

peddy peddy at common-lisp.net
Sat Mar 1 19:19:18 UTC 2008


Update of /project/clouchdb/cvsroot/clouchdb/src
In directory clnet:/tmp/cvs-serv28981/src

Modified Files:
	changelog.txt clouchdb.lisp tests.lisp 
Log Message:
- Updated docs with complex view key info
- Updated examples with complex view examples


--- /project/clouchdb/cvsroot/clouchdb/src/changelog.txt	2008/01/19 20:18:57	1.7
+++ /project/clouchdb/cvsroot/clouchdb/src/changelog.txt	2008/03/01 19:19:17	1.8
@@ -1,4 +1,12 @@
 
+0.0.9:
+
+  - View functions now work with complex key types, e.g.
+    (invoke-view "foo" "bar" :key '("kipple" "bark"))
+  - Updated docs to reflect change described above
+  - Fixed other doc inaccuracies having to do with cl-json/case
+    encoding related changes.
+
 0.0.8:
 
   - Function set-document-property now operates non-destructively, be
--- /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp	2008/02/22 01:33:49	1.22
+++ /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp	2008/03/01 19:19:17	1.23
@@ -25,7 +25,7 @@
 (in-package :clouchdb)
 
 (defvar *host* "localhost" "CouchDb server host name")
-(defvar *port* "5984" 
+(defvar *port* "5984"
   "As of version 7.2, the IANA assigned CouchDb port (was 8888)")
 (defvar *db-name* "default" "Default database name")
 (defvar *protocol* "http" "http or https")
--- /project/clouchdb/cvsroot/clouchdb/src/tests.lisp	2008/01/19 20:18:57	1.11
+++ /project/clouchdb/cvsroot/clouchdb/src/tests.lisp	2008/03/01 19:19:17	1.12
@@ -655,6 +655,42 @@
 			:|rows| (invoke-view "friend" "fname" :key "claire")))
  	       (length (contains-property *people* :friends :pval "claire"))))
 
+
+(addtest (clouchdb-view-tests)
+  (:documentation "Create a view and see if it can be queried with a complex key")
+  create-view-keyquery-test2
+  (ensure 
+   (document-property :|ok|
+                      (create-view "views" 
+                                   (cons "view"
+                                         (ps (lambda (doc)
+                                               (with-slots (*city* *friends*) doc
+                                                 (dolist (friend *friends*)
+                                                   (map (list *city* friend) doc)))))))))
+   (ensure-same 1 
+                (length (document-property 
+                         :|rows| 
+                         (invoke-view "views" "view" :key '("boston" "charles"))))))
+
+(addtest (clouchdb-view-tests)
+  (:documentation "Create a view and see if it can be queried with a complex start and end key")
+  create-view-keyquery-test3
+  (ensure 
+   (document-property :|ok|
+                      (create-view "views" 
+                                   (cons "view"
+                                         (ps (lambda (doc)
+                                               (with-slots (*city* *friends*) doc
+                                                 (dolist (friend *friends*)
+                                                   (map (list *city* friend) doc)))))))))
+   (ensure-same 1 
+                (length (document-property 
+                         :|rows| 
+                         (invoke-view "views" 
+                                      "view" 
+                                      :start-key '("boston" "c")
+                                      :end-key '("boston" "d"))))))
+
 ;;
 ;;
 ;;




More information about the clouchdb-cvs mailing list