finish up
diff --git a/docs/_includes/api/batch_create.html b/docs/_includes/api/batch_create.html index 66d9cbb..523507c 100644 --- a/docs/_includes/api/batch_create.html +++ b/docs/_includes/api/batch_create.html
@@ -111,7 +111,7 @@ }, { title : 'Space Oddity', - artist : 'David Bowie', + artist : 'David Bowie', _id : "doc2", _rev : "1-7b80fc50b6af7a905f368670429a757e" } @@ -132,7 +132,7 @@ }, { title : 'Space Oddity', - artist : 'David Bowie', + artist : 'David Bowie', _id : "doc2", _rev : "1-7b80fc50b6af7a905f368670429a757e" } @@ -157,7 +157,7 @@ }, { title : 'Space Oddity', - _deleted : true, + _deleted : true, _id : "doc2", _rev : "1-7b80fc50b6af7a905f368670429a757e" } @@ -178,7 +178,7 @@ }, { title : 'Space Oddity', - _deleted : true, + _deleted : true, _id : "doc2", _rev : "1-7b80fc50b6af7a905f368670429a757e" }
diff --git a/docs/_includes/api/changes.html b/docs/_includes/api/changes.html index 16b722b..fbc02e4 100644 --- a/docs/_includes/api/changes.html +++ b/docs/_includes/api/changes.html
@@ -38,6 +38,8 @@ include_docs: true }).on('change', function(change) { // handle change +}).on('complete', function(info) { + // changes() was canceled }).on('error', function (err) { console.log(err); }); @@ -132,7 +134,7 @@ If you don't specify `{live: true}`, then you can also use `changes()` in the standard callback/promise style, and it will be treated as a single-shot request, which -returns a list of the changes: +returns a list of the changes (i.e. what the `'complete'` event emits): {% include code/start.html id="changes1" type="callback" %} {% highlight js %}
diff --git a/docs/_includes/api/compaction.html b/docs/_includes/api/compaction.html index da997ea..04a8c63 100644 --- a/docs/_includes/api/compaction.html +++ b/docs/_includes/api/compaction.html
@@ -34,9 +34,7 @@ #### Example Response: {% highlight js %} -{ - "ok" : "true" -} +{ "ok" : "true" } {% endhighlight %}
diff --git a/docs/_includes/api/debug_mode.html b/docs/_includes/api/debug_mode.html index 2a7bca8..a78e475 100644 --- a/docs/_includes/api/debug_mode.html +++ b/docs/_includes/api/debug_mode.html
@@ -10,5 +10,25 @@ In your browser console, you should then see something like this: +{% include img.html src="debug_mode.png" alt="Coloured Log Output" %} +In Node.js, you can also set a command-line flag: +{% highlight bash %} +DEBUG=pouchdb:* node myscript.js +{% endhighlight %} + +You can also enable debugging of specific modules. Currently we only have `pouchb:api` (API-level calls) and `pouchdb:http` (HTTP requests): + +{% highlight js %} +PouchDB.debug.enable('pouchdb:api'); // or +PouchDB.debug.enable('pouchdb:http'); +{% endhighlight %} + +These settings are saved to the browser's LocalStorage. So to disable them, you must call: + +{% highlight js %} +PouchDB.debug.disable(); +{% endhighlight %} + +Your users won't see debug output unless you explicitly call `PouchDB.debug.enable()` within your application code. \ No newline at end of file
diff --git a/docs/_includes/api/get_attachment.html b/docs/_includes/api/get_attachment.html index 939a526..7f2b0e6 100644 --- a/docs/_includes/api/get_attachment.html +++ b/docs/_includes/api/get_attachment.html
@@ -32,7 +32,7 @@ #### Inline base64 attachments -You can specify `{attachments: true}` to most read operations (such as `get()`, `allDocs()`, `changes()`, and `query()`). The attachment data will then be included inlined in the resulting list of docs. However, it will always be supplied as base64. For example: +You can specify `{attachments: true}` to most "read" operations, such as `get()`, `allDocs()`, `changes()`, and `query()`. The attachment data will then be included inlined in the resulting doc(s). However, it will always be supplied as base64. For example: {% highlight js %} {
diff --git a/docs/_includes/api/query_database.html b/docs/_includes/api/query_database.html index ea951e5..53288f1 100644 --- a/docs/_includes/api/query_database.html +++ b/docs/_includes/api/query_database.html
@@ -4,7 +4,7 @@ db.query(fun, [options], [callback]) {% endhighlight %} -Retrieves a view, which allows you to perform more complex queries on PouchDB. The [CouchDB documentation for map/reduce](http://docs.couchdb.org/en/latest/couchapp/views/intro.html) applies to PouchDB. +Invoke a map/reduce function, which allows you to perform more complex queries on PouchDB than what you get with [allDocs()](#batch_fetch). The [CouchDB documentation for map/reduce](http://docs.couchdb.org/en/latest/couchapp/views/intro.html) applies to PouchDB. Since views perform a full scan of all documents, this method may be slow, unless you first save your view in a design document. Read the [query guide](http://localhost:4000/guides/queries.html) for a good tutorial. @@ -23,8 +23,8 @@ All options default to `false` unless otherwise specified. * `fun`: Map/reduce function, which can be one of the following: + * A full CouchDB-style map/reduce view: `{map : ..., reduce: ...}`. * A map function by itself (no reduce). - * A full CouchDB-style map/reduce object: `{map : ..., reduce: ...}`. * The name of a view in an existing design document (e.g. `'mydesigndoc/myview'`, or `'myview'` as a shorthand for `'myview/myview'`). * `options.reduce`: Reduce function, or the string name of a built-in function: `'_sum'`, `'_count'`, or `'_stats'`. Defaults to `false` (no reduce). * Tip: if you're not using a built-in, [you're probably doing it wrong](http://youtu.be/BKQ9kXKoHS8?t=865s).
diff --git a/docs/_includes/api/replication.html b/docs/_includes/api/replication.html index 130b85b..7113a70 100644 --- a/docs/_includes/api/replication.html +++ b/docs/_includes/api/replication.html
@@ -53,7 +53,7 @@ db.replicate.from(remoteDB, [options]); {% endhighlight %} -`db` and `remoteDB` can both either be strings, or the `PouchDB` objects themselves. If you have special HTTP options on a remote database, you will want to use `PouchDB` objects instead of strings, so that the options are used. +The `remoteDB` can either be a string or a `PouchDB` object. If you have special ajax options on a remote database, you will want to use `PouchDB` objects instead of strings, so that the options are used. #### Replication events @@ -63,7 +63,7 @@ * __`active`__ - This event fires when the replication starts actively processing changes; e.g. when it recovers from an error or new changes are available. * __`denied`__ (`err`) - This event fires if a document failed to replicate due to validation or authorization errors. * __`error`__ (`err`) - This event is fired when the replication is stopped due to an unrecoverable failure. If `retry` is `false`, this will also fire when the user goes offline or another network error occurs (so you can handle retries yourself, if you want). -* __`uptodate`__ *deprecated* - This event fires when a live replication has caught up and is waiting on future changes. This should be replaced by using the `paused` event. +* __`uptodate`__ (*deprecated*) - This event fires when a live replication has caught up and is waiting on future changes. This should be replaced by using the `paused` event. #### Single-shot
diff --git a/docs/_includes/api/sync.html b/docs/_includes/api/sync.html index 1d8524e..4fe1dc4 100644 --- a/docs/_includes/api/sync.html +++ b/docs/_includes/api/sync.html
@@ -23,7 +23,7 @@ ### Options -Please refer to [Replication](api.html#replication) for documentation on options, as `sync()` is just a convenience method that entails bidirectional replication. +Please refer to [replicate()](api.html#replication) for documentation on options, as `sync()` is just a convenience method that entails bidirectional replication. #### Example Usage: {% highlight js %} @@ -53,6 +53,6 @@ db.sync(remoteDB, [options]); {% endhighlight %} -For any further details, please refer to [Replication](api.html#replication). +For any further details, please refer to [replicate()](api.html#replication).
diff --git a/docs/_includes/api/view_cleanup.html b/docs/_includes/api/view_cleanup.html index bf21952..fd8e0c2 100644 --- a/docs/_includes/api/view_cleanup.html +++ b/docs/_includes/api/view_cleanup.html
@@ -32,7 +32,5 @@ #### Example Response: {% highlight js %} -{ - "ok" : "true" -} +{ "ok" : "true" } {% endhighlight %} \ No newline at end of file