[clouchdb-cvs] CVS clouchdb/public_html

peddy peddy at common-lisp.net
Tue Dec 18 02:16:02 UTC 2007


Update of /project/clouchdb/cvsroot/clouchdb/public_html
In directory clnet:/tmp/cvs-serv31727/public_html

Modified Files:
	index.html 
Log Message:
Updated document API documentation
Removed junk code


--- /project/clouchdb/cvsroot/clouchdb/public_html/index.html	2007/12/17 23:22:23	1.5
+++ /project/clouchdb/cvsroot/clouchdb/public_html/index.html	2007/12/18 02:16:02	1.6
@@ -37,6 +37,11 @@
   <li><h3><a href="#examples">Examples</a></h3></li>
   <li><h3><a href="#support">Support and mailing lists</a></h3></li>
   <li><h3><a href="#reference">API Reference</a></h3></li>
+  <ul>
+    <li><h4><a href="#db-api-reference">Connection and Database API</a></h4></li>
+    <li><h4><a href="#doc-api-reference">Document API</a></h4></li>
+    <li><h4><a href="#views-api-reference">Views API</a></h4></li>
+  </ul>
   <li><h3><a href="#symbols">Symbol Index</a></h3></li>
 </ul>
 
@@ -366,7 +371,7 @@
 
 <h2><a name="reference">API Reference</a></h2>
 
-<h3>Server Connection and Database Management API</h3>
+<h3><a name="db-api-reference">Server Connection and Database Management API</a></h3>
 
 <p>
   The API described in this has to do with managing CouchDb server
@@ -510,17 +515,71 @@
 <p>See (<a href="#sym-set-connection">set-connection</a>)</p>
 </blockquote>
 
-<h3>Document API</h3>
+<h3><a name="doc-api-reference">Document API</a></h3>
+<p>
+  The Document ID
+</p>
+<blockquote>
+  <p>
+    Documents in clouchdb are identified by a document ID string which
+    must be unique within the database that will contain the
+    document. The ID string may either be specified when the document
+    is created or it can be provided by the CouchDb server.
+  </p>
+</blockquote>
 
 <p>
-  Documents in clouchdb are identified by a document ID, their content
-  takes the form of an associative list. The native document
-  representation in CouchDb is a <a href="http://json.org/">JSON</a>
-  object. Using
-  <a href="http://common-lisp.net/project/cl-json/">cl-json</a>,
-  clouchdb automatically translates documents between JSON and Lisp
-  associative lists.
+  Document Content
 </p>
+<blockquote>
+  <p>
+    Document content takes the form of an associative list. The car of
+    each element of the associative list may be either a string or a
+    symbol. For example, each of the following calls to
+    (create-document) creates a document with a field named "name":
+  </p>
+
+  <pre class="code">
+(create-document '((:name . "Max"))
+(create-document '((name . "Max"))
+(create-document '(("name" . "Max"))
+</pre>
+
+  <p>
+    Field names in CouchDb are case sensitive. To specify a field name
+    that uses upper case characters, you must use a string value as
+    symbols are always converted to lower case. In the following
+    example a single document is created with two fields, "name" and
+    "Name":
+  </p>
+
+  <pre class="code">
+(create-document '((:name . "Max")
+                   ("Name" . "Max")))
+</pre>
+
+  <p>
+    The native document representation in the CouchDb protocol is
+    a <a href="http://json.org/">JSON</a> object. Using
+    <a href="http://common-lisp.net/project/cl-json/">cl-json</a>,
+    clouchdb automatically translates documents between JSON and Lisp
+    associative lists. 
+  </p>
+
+  <p>
+    The value of a document field may be a string, a number, a list,
+    or an associative list. Document field values may be nested to
+    create very complex document structures.
+  </p>
+
+<pre class="code">
+(create-document '((:string . "String Value")
+                   (:number . 3.1415926535)
+                   (:list . (milk eggs "green beans"))
+                   (:alist . ((
+</pre>
+
+</blockquote>
 
 <p>
   Special Properties
@@ -678,7 +737,7 @@
 </blockquote>
 
 <hr/>
-<h4>Views API</h4>
+h4><a name="views-api-reference">Views API</a></h4>
 
 <p>
   Views are the mechanism with which documents are queried in




More information about the clouchdb-cvs mailing list