[clouchdb-cvs] CVS clouchdb/public_html
peddy
peddy at common-lisp.net
Sun Dec 9 16:03:21 UTC 2007
Update of /project/clouchdb/cvsroot/clouchdb/public_html
In directory clnet:/tmp/cvs-serv2019/public_html
Modified Files:
index.html
Log Message:
- Fixed ad-hoc-view and invoke-view functions so that they now use
all CouchDb view options
- Added generic keyword parameter to URL parameter translation code
- Changed default CouchDb port to IANA assigned 5984
- Added more comments
--- /project/clouchdb/cvsroot/clouchdb/public_html/index.html 2007/12/01 14:19:59 1.1.1.1
+++ /project/clouchdb/cvsroot/clouchdb/public_html/index.html 2007/12/09 16:03:21 1.2
@@ -32,6 +32,7 @@
<h2>Contents</h2>
<ul>
+ <li><h3><a href="#news">News</a></h3></li>
<li><h3><a href="#download">Download and Installation</a></h3></li>
<li><h3><a href="#examples">Examples</a></h3></li>
<li><h3><a href="#support">Support and mailing lists</a></h3></li>
@@ -39,6 +40,25 @@
<li><h3><a href="#symbols">Symbol Index</a></h3></li>
</ul>
+<h2><a name="news">News</a></h2>
+<p>
+ <ul>
+ <li><b>Dec 9, 2007</b> - Version 0.0.4: Updated
+ (<a href="#sym-invoke-view">invoke-view</a>) and
+ (<a href="#sym-ad-hoc-view">ad-hoc-view</a>) to use all options
+ supported by corresponding CouchDb API. Somehow I'd missed
+ these before.
+ </li>
+ <li><b>Nov 28, 2007</b> -
+ CouchDb 7.2 now uses IANA assigned port 5984 instead of 8888.
+ As of release 0.0.4, clouchdb's default has been changed to
+ reflect this fact. If you're using pre-7.2 CouchDb versions with
+ clouchdb 0.0.4, be sure to set your port to 8888. There should
+ be no other compatibility issues.
+ </li>
+ </ul>
+</p>
+
<h2><a name="download">Download and Installation</a></h2>
<p>
The current download link for clouchdb can be found at
@@ -135,10 +155,10 @@
<p>
NB: If you try these examples I suggest also viewing the results via
CouchDb's HTML UI
- at <a href="http://localhost:8888/_utils/browse/index.html">
- http://localhost:8888/_utils/browse/index.html</a>, of course you'll
- need to adjust the URL for the actual CouchDb server and port in
- use.
+ at <a href="http://localhost:8888/_utils/browse/index.html">http://localhost:8888/_utils/browse/index.html</a>,
+ (or <a href="http://localhost:5984/_utils/browse/index.html">http://localhost:5984/_utils/browse/index.html</a>
+ if you're using ClouchDb version 7.2 or later), of course you'll need to
+ adjust the URL for the actual CouchDb server and port in use.
</p>
<h4>Example 1</h4>
@@ -164,7 +184,7 @@
;; Get CouchDb Server Information by specifying a nil DB name
CLOUCHDB-USER> <b>(get-db-info :db-name nil)</b>
((:COUCHDB . "Welcome") (:VERSION . "0.7.0a575"))
-;; Create the database
+;; Create database "test-db", which we named above
CLOUCHDB-USER> <b>(create-db)</b>
((:OK . T))
;; Create a document with one field, and give it an ID of "gjc"
@@ -345,6 +365,22 @@
error if the database already exists. A value of :ignore will simply
ignore the this error. A value of :recreate will delete the database
if it exists, and then recreate it.
+<p>
+Example:
+<pre class="code">
+;; Create the database named in the current connection settings
+(set-connection :db-name "tvland")
+(create-db)
+<b>=></b> ((:OK . T))
+
+;; Specify name of database to create, if it already exists
+;; then ignore the request (don't generate error, don't
+;; recreate database), return (:ignored . T) if database did
+;; exist
+(create-db :db-name "tvland"
+<b>=></b> ((:OK . T) (:IGNORED . T))
+</pre>
+<p />
</blockquote>
<p/>[Function]<br />
@@ -357,6 +393,25 @@
<p/> If :ignore is specified for the if-missing parameter, errors
resulting from the attempt to delete a non-existent database are ignored.
+
+<p>
+Example:
+<pre class="code">
+;; Create the database named in the current connection settings
+(set-connection :db-name "tvland")
+(delete-db)
+<b>=></b> ((:OK . T))
+
+;; Specify name of database to delete, if it doesn't exist
+;; then ignore the request (don't generate error), return
+;; ((:ERROR . "not_found") (:REASON . "missing")) if
+;; database did not exist
+(delete-db :db-name "tvland"
+<b>=></b> ((:ERROR . "not_found") (:REASON . "missing"))
+</pre>
+<p />
+
+
</blockquote>
<p/>[Function]<br />
@@ -387,7 +442,7 @@
Sets the host name, database name, protocol ("http" or "https") and
port number for the top-level connection to the CouchDb
server. Default connection settings are host="localhost",
-protocol="http", port="8888" and database="default".
+protocol="http", port="5984" and database="default".
<p />
See (<a href="#sym-with-connection">with-connection</a>)
</blockquote>
@@ -406,6 +461,13 @@
;; Get document from specified host and database
(with-connection (:host "cornichon.cucumber.net" :db-name "rfc")
(get-document "2616"))
+
+;; Copy document identified by "someid" from database "otherdb" to
+;; current database, use "copy-of-someid" for copied document ID.
+(put-document
+ (with-connection (:db-name "otherdb")
+ (get-document "someid"))
+ :id "copy-of-someid")
</pre>
<p />
See (<a href="#sym-set-connection">set-connection</a>)
@@ -582,13 +644,56 @@
Please refer
to <a href="http://www.couchdbwiki.com/index.php?title=HTTP_View_API">
CouchDb View API Documentation</a> for general information about CouchDb views.
+ <b>Note</b>: Many details of CouchDb views have yet to be
+ documented. In the meantime,
+ see <a href="http://www.cmlenz.net/blog/2007/10/couchdb-joins.html">this
+ blog post</a> for some useful hints.
</p>
<p/>[Function]<br />
-<a name="sym-ad-hoc-view"><b>ad-hoc-view</b></a> view
+<a name="sym-ad-hoc-view"><b>ad-hoc-view</b></a> view &key key
+ start-key start-key-docid end-key count update
+ descending skip
<blockquote>
Executes a one-time, non persistent view (query). The view is specified as a
JavaScript anonymous function.
+<p>
+ Keyword parameters
+ <ul>
+ <li>
+ <b>key</b> A value to match against the document property or
+ properties mapped in the view. Only documents matching this
+ value are returned.
+ </li>
+ <li>
+ <b>start-key</b> Return documents with mapped keys greater than or
+ equal to this value.
+ </li>
+ <li>
+ <b>start-key-docid</b> The document ID of the first document to return.
+ </li>
+ <li>
+ <b>end-key</b> Return documents with mapped keys less than this
+ value.
+ </li>
+ <li>
+ <b>count</b> The maximum number of rows to return. If zero, returns
+ only result meta-data.
+ </li>
+ <li>
+ <b>update</b> If nil, CouchDb does not refresh view data when
+ executing the query. This is a performance option that may
+ result is faster queries but potentially not return up-to-date
+ data.
+ </li>
+ <li>
+ <b>descending</b> If true, return results in reverse order.
+ </li>
+ <li>
+ <b>skip</b> Number of result rows to skip.
+ </li>
+ </ul>
+</p>
<p />
Example:
<pre class="code">
@@ -662,9 +767,49 @@
</blockquote>
<p/>[Function]<br />
-<a name="sym-invoke-view"><b>invoke-view</b></a> id view :key key
+<a name="sym-invoke-view"><b>invoke-view</b></a> id view &key key
+ start-key start-key-docid end-key count update descending skip
+
<blockquote>
Invoke specified view in identified view document.
+<p>
+ Keyword parameters
+ <ul>
+ <li>
+ <b>key</b> A value to match against the document property or
+ properties mapped in the view. Only documents matching this
+ value are returned.
+ </li>
+ <li>
+ <b>start-key</b> Return documents with mapped keys greater than or
+ equal to this value.
+ </li>
+ <li>
+ <b>start-key-docid</b> The document ID of the first document to return.
+ </li>
+ <li>
+ <b>end-key</b> Return documents with mapped keys less than this
+ value.
+ </li>
+ <li>
+ <b>count</b> The maximum number of rows to return. If zero, returns
+ only result meta-data.
+ </li>
+ <li>
+ <b>update</b> If nil, CouchDb does not refresh view data when
+ executing the query. This is a performance option that may
+ result is faster queries but potentially not return up-to-date
+ data.
+ </li>
+ <li>
+ <b>descending</b> If true, return results in reverse order.
+ </li>
+ <li>
+ <b>skip</b> Number of result rows to skip.
+ </li>
+ </ul>
+</p>
+
<p />
Example:
<pre class="code">
More information about the clouchdb-cvs
mailing list