[clouchdb-cvs] CVS clouchdb/public_html

peddy peddy at common-lisp.net
Fri Sep 10 23:46:39 UTC 2010


Update of /project/clouchdb/cvsroot/clouchdb/public_html
In directory cl-net:/tmp/cvs-serv8201/public_html

Modified Files:
	index.html 
Log Message:
Add doc for (changes)


--- /project/clouchdb/cvsroot/clouchdb/public_html/index.html	2010/09/06 22:21:27	1.13
+++ /project/clouchdb/cvsroot/clouchdb/public_html/index.html	2010/09/10 23:46:39	1.14
@@ -231,7 +231,7 @@
    :DOCUMENT-FETCH-FN NIL
    :DOCUMENT-UPDATE-FN NIL)
 
-;; Get CouchDb Server Information. This is the first communication
+;; GetCouchDb Server Information. This is the first communication
 ;; with the CouchDb server.
 CLOUCHDB-USER> <b>(get-couchdb-info)</b>
 ((:|couchdb| . "Welcome") (:|version| . "0.10.0a788899"))
@@ -528,6 +528,52 @@
 </blockquote>
 
 <p>[Function]<br />
+<a name="sym-changes"><b>changes</b></a> &key db
+</p>
+<blockquote>
+<p>
+  Return the document change activity for the current database or a
+  specific database specified with the <b>:db</b> keyword
+  parameter. The database can be specified as a string for a database
+  in the current CouchDb host, or as a db structure to specify a
+  database on a host other than the current one specified in *couchdb*.
+</p>
+Example:
+</p>
+<pre class="code">
+;; Changes for the current database
+(changes)
+<b>=></b> 
+((:|results|
+  ((:|seq| . 4) (:|id| . "_design/example")
+   (:|changes| ((:|rev| . "1-f83b5f3e154eb3c0ba2d721ad53211b3"))))
+  ((:|seq| . 5) (:|id| . "_design/toast")
+   (:|changes| ((:|rev| . "1-3525a1d974ba13a34d26e305116feab2")))))
+ (:|last_seq| . 5))
+
+;; Specify database
+(changes :db "example")
+<b>=></b> 
+((:|results|
+  ((:|seq| . 4) (:|id| . "_design/example")
+   (:|changes| ((:|rev| . "1-f83b5f3e154eb3c0ba2d721ad53211b3"))))
+  ((:|seq| . 5) (:|id| . "_design/toast")
+   (:|changes| ((:|rev| . "1-3525a1d974ba13a34d26e305116feab2")))))
+ (:|last_seq| . 5))
+
+;; Specify database and host
+(changes :db (make-db :name "example" :host "somehost"))
+<b>=></b> 
+((:|results|
+  ((:|seq| . 4) (:|id| . "_design/example")
+   (:|changes| ((:|rev| . "1-f83b5f3e154eb3c0ba2d721ad53211b3"))))
+  ((:|seq| . 5) (:|id| . "_design/toast")
+   (:|changes| ((:|rev| . "1-3525a1d974ba13a34d26e305116feab2")))))
+ (:|last_seq| . 5))
+</pre>
+</blockquote>
+
+<p>[Function]<br />
 <a name="sym-compact-db"><b>compact-db</b></a> &key db
 </p>
 <blockquote>
@@ -825,8 +871,28 @@
   structure. The <b>source</b> database defaults to the current value
   of *couchdb*.
 </p>
+<p>
+  If the <b>:create-target</b> keyword parmaeter is true the database
+  will automatically create the replication target if necessary
+  (requires CouchDb version 0.11+)
+</p>
 </blockquote>
 
+<p>
+  Example:
+</p>
+<pre class="code">
+  ;; Replicate current database to databased named "backup" on the same server
+  (replicate "backup")
+
+  ;; Replicate current database to remotely hosted "backup" database
+  (replicate (make-db :name "backup" :host "remote"))
+   
+  ;; Replicate one remote database to another
+  (replicate (make-db :name "backup" :host "remoteB")
+     :source (make-db :name "source" :host "remoteA"))
+</pre>
+
 <p>[Macro]<br /> 
 <a name="sym-with-connection"><b>with-connection</b></a> (&key db
 host name protocol port document-update-fn document-fetch-fn)
@@ -1924,7 +1990,8 @@
                    (if (eql doc.*name* "Laraby")
                      (emit nil doc))))))
 </pre>
-<p>See (<a href="#sym-create-view">create-view</a>) and <a href="#example-3">Example 3</a></p>
+<p>See (<a href="#sym-create-ps-view">create-ps-view</a>) and 
+<a href="#example-3">Example 3</a></p>
 </blockquote>
 
 <p>[Function]<br />
@@ -1977,7 +2044,7 @@
 Delete view document identified by id. If revision is specified,
 delete specific revision of view document.
 </p>
-<p>See (<a href="#sym-create-view">create-view</a>)</p>
+<p>See (<a href="#sym-create-ps-view">create-ps-view</a>)</p>
 </blockquote>
 
 <p>[Function]<br />
@@ -2039,7 +2106,7 @@
 (create-document '((:name . "Laraby")))
 
 ;; Views defined with <a href="http://www.cliki.net/Parenscript/">Parenscript</a>
-(create-view <b>"names"</b>
+(create-ps-view <b>"names"</b>
   (cons <b>"laraby"</b>
         (ps (lambda (doc)  ;; parameter-less view
               (with-slots (name) doc
@@ -2057,7 +2124,7 @@
 (invoke-view <b>"names" "name" :key "Laraby"</b>)
 </pre>
 <p>
-See (<a href="#sym-create-view">create-view</a>)
+See (<a href="#sym-create-ps-view">create-ps-view</a>)
 (<a href="#sym-ad-hoc-view">ad-hoc-view</a>)
 and <a href="#example-3">Example 3</a>
 </p>
@@ -2151,6 +2218,7 @@
   <a href="#sym-attachment-name">attachment-name</a> <br />
   <a href="#sym-bulk-document-update">bulk-document-update</a> <br />
   <a href="#sym-clouchdb-error">clouchdb-error</a> <br />
+  <a href="#sym-changes">changes</a> <br />
   <a href="#sym-compact-db">compact-db</a> <br />
   <a href="#sym-copy-document">copy-document</a> <br />
   <a href="#sym-couchdb">*couchdb*</a> <br />
@@ -2159,7 +2227,6 @@
   <a href="#sym-create-document">create-document</a> <br />
   <a href="#sym-create-ps-view">create-ps-view</a> <br />
   <a href="#sym-create-temp-db">create-temp-db</a> <br />
-  <a href="#sym-create-view">create-view</a> <br />
   <a href="#sym-db-already-exists">db-already-exists</a> <br />
   <a href="#sym-db-does-not-exist">db-does-not-exist</a> <br />
   <a href="#sym-db-existential-error">db-existential-error</a> <br />





More information about the clouchdb-cvs mailing list