# HG changeset patch # User Atul Varma # Date 1240276178 25200 # Node ID ebf8936fc6966cf849fc7359110b46df117eb468 # Parent f65007998121f4defb914e0005244c42599d0805 More tutorial additions. diff -r f65007998121 -r ebf8936fc696 tutorial.html --- a/tutorial.html Mon Apr 20 17:50:37 2009 -0700 +++ b/tutorial.html Mon Apr 20 18:09:38 2009 -0700 @@ -21,8 +21,19 @@ software. It currently lacks a lot of CouchDB's features that it ought to have, and its API is not stable at all.

+

Finally, a note about the code examples in this tutorial: they're +actually being executed in your browser, and their output is sometimes +being displayed in this tutorial too. While this helps ensure that the +software is working as intended and also allows for some interactive +learning opportunities, right now it also means that some parts of the +code examples may look a bit unusual. Furthermore, if you see any +conspicuously blank areas in this tutorial, it could be because the +tutorial code crashed—our apologies if this occurs.

+

With that out of the way, let's get started.

+

Getting Started

+

Suppose we want to add offline support for a blog. To get a database called blog-posts in BrowserCouch, you can use the following function:

@@ -125,7 +136,7 @@ This explains what the values argument passed to reduce() is.

-

The keys argument is a list of two-tuples, the first of +

The keys argument is a list of 2-tuples, the first of which is the key, and the second of which is the document id that emitted the key during the map phase.

@@ -183,8 +194,8 @@

There's features in the API that aren't covered here, so check out the check out the annotated source code for the test -suite for more sample code.

+href="index.html#js/tests.js">test suite's annotated source code +for more examples.