couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject documentation commit: updated refs/heads/master to 162b7a0
Date Wed, 07 Sep 2016 09:52:54 GMT
Repository: couchdb-documentation
Updated Branches:
  refs/heads/master 2614cfda4 -> 162b7a0c6


update _changes API documentation for 2.0

 * use string-based sequence identifiers everywhere
 * document the `pending` field in responses
 * add a note about ordering/idempotency
 * document the `_selector` filter

Fixes COUCHDB-3121


Project: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/commit/162b7a0c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/tree/162b7a0c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/diff/162b7a0c

Branch: refs/heads/master
Commit: 162b7a0c65caa796ab162139b5d69db5d542f3d3
Parents: 2614cfd
Author: Will Holley <willholley@gmail.com>
Authored: Tue Sep 6 16:17:42 2016 +0100
Committer: Will Holley <willholley@gmail.com>
Committed: Tue Sep 6 21:25:23 2016 +0100

----------------------------------------------------------------------
 src/api/database/changes.rst | 164 ++++++++++++++++++++++++++++++--------
 src/couchapp/ddocs.rst       |  18 ++---
 src/json-structure.rst       |   6 +-
 3 files changed, 143 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/162b7a0c/src/api/database/changes.rst
----------------------------------------------------------------------
diff --git a/src/api/database/changes.rst b/src/api/database/changes.rst
index d9f402f..fde4077 100644
--- a/src/api/database/changes.rst
+++ b/src/api/database/changes.rst
@@ -71,7 +71,7 @@
     :query number limit: Limit number of result rows to the specified value
         (note that using ``0`` here has the same effect as ``1``).
     :query since: Start the results from the change immediately after the given
-        sequence number. Can be integer number or ``now`` value.
+        update sequence. Can be valid update sequence or ``now`` value.
         Default is ``0``.
     :query string style: Specifies how many revisions are returned in
         the changes array. The default, ``main_only``, will only return
@@ -95,7 +95,8 @@
                            - :mimetype:`text/plain; charset=utf-8`
     :>header ETag: Response hash is changes feed is `normal`
     :>header Transfer-Encoding: ``chunked``
-    :>json number last_seq: Last change sequence number
+    :>json json last_seq: Last change update sequence
+    :>json number pending: Count of remaining items in the feed
     :>json array results: Changes made to a database
     :code 200: Request completed successfully
     :code 400: Bad request
@@ -104,7 +105,7 @@
 
     :json array changes: List of document`s leafs with single field ``rev``
     :json string id: Document ID
-    :json number seq: Update sequence number
+    :json json seq: Update sequence
 
     **Request**:
 
@@ -127,7 +128,8 @@
         Transfer-Encoding: chunked
 
         {
-            "last_seq": 11,
+            "last_seq": "5-g1AAAAIreJyVkEsKwjAURZ-toI5cgq5A0sQ0OrI70XyppcaRY92J7kR3ojupaSPUUgotgRd4yTlwbw4A0zRUMLdnpaMkwmyF3Ily9xBwEIuiKLI05KOTW0wkV4rruP29UyGWbordzwKVxWBNOGMKZhertDlarbr5pOT3DV4gudUC9-MPJX9tpEAYx4TQASns2E24ucuJ7rXJSL1BbEgf3vTwpmedCZkYa7Pulck7Xt7x_usFU2aIHOD4eEfVTVA5KMGUkqhNZV-8_o5i",
+            "pending": 0,
             "results": [
                 {
                     "changes": [
@@ -136,7 +138,7 @@
                         }
                     ],
                     "id": "6478c2ae800dfc387396d14e1fc39626",
-                    "seq": 6
+                    "seq": "3-g1AAAAG3eJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MSGXAqSVIAkkn2IFUZzIkMuUAee5pRqnGiuXkKA2dpXkpqWmZeagpu_Q4g_fGEbEkAqaqH2sIItsXAyMjM2NgUUwdOU_JYgCRDA5ACGjQfn30QlQsgKvcjfGaQZmaUmmZClM8gZhyAmHGfsG0PICrBPmQC22ZqbGRqamyIqSsLAAArcXo"
                 },
                 {
                     "changes": [
@@ -146,7 +148,7 @@
                     ],
                     "deleted": true,
                     "id": "5bbc9ca465f1b0fcd62362168a7c8831",
-                    "seq": 9
+                    "seq": "4-g1AAAAHXeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBMZc4EC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HqQ_kQG3qgSQqnoUtxoYGZkZG5uS4NY8FiDJ0ACkgAbNx2cfROUCiMr9CJ8ZpJkZpaaZEOUziBkHIGbcJ2zbA4hKsA-ZwLaZGhuZmhobYurKAgCz33kh"
                 },
                 {
                     "changes": [
@@ -158,7 +160,7 @@
                         }
                     ],
                     "id": "729eb57437745e506b333068fff665ae",
-                    "seq": 11
+                    "seq": "5-g1AAAAIReJyVkE0OgjAQRkcwUVceQU9g-mOpruQm2tI2SLCuXOtN9CZ6E70JFmpCCCFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloRid3MMkEUoJHbXbOxVy6arc_SxQWQzRVHCuYHaxSpuj1aqbj0t-3-AlSrZakn78oeSvjRSIkIhSNiCFHbsKN3c50b02mURvEB-yD296eNOzzoRMRLRZ98rkHS_veGcC_nR-fGe1gaCaxihhjOI2lX0BhniHaA"
                 }
             ]
         }
@@ -174,6 +176,15 @@
 .. versionchanged:: 1.4.0 Support ``Last-Event-ID`` header.
 .. versionchanged:: 1.6.0 added ``attachments`` and ``att_encoding_info``
    parameters
+.. versionchanged:: 2.0.0 update sequences can be any valid json object
+
+.. note::
+    If the specified replicas of the shards in any given since value are
+    unavailable, alternative replicas are selected, and the last known
+    checkpoint between them is used. If this happens, you might see changes
+    again that you have previously seen. Therefore, an application making use
+    of the `_changes` feed should be ‘idempotent’, that is, able to receive the
+    same data multiple times, safely.
 
 .. warning::
     Using the ``attachments`` parameter to include attachments in the changes
@@ -181,6 +192,10 @@
     Base64-encoding that is used leads to a 33% overhead (i.e. one third) in
     transfer size for attachments.
 
+...warning::
+    The results returned by `_changes` are partially ordered. In other words,
+    the order is not guaranteed to be preserved for multiple calls.
+
 .. http:post:: /{db}/_changes
     :synopsis: Returns changes for the given database for certain document IDs
 
@@ -218,7 +233,8 @@
         Transfer-Encoding: chunked
 
         {
-            "last_seq": 38,
+            "last_seq": "5-g1AAAAIreJyVkEsKwjAURZ-toI5cgq5A0sQ0OrI70XyppcaRY92J7kR3ojupaSPUUgotgRd4yTlwbw4A0zRUMLdnpaMkwmyF3Ily9xBwEIuiKLI05KOTW0wkV4rruP29UyGWbordzwKVxWBNOGMKZhertDlarbr5pOT3DV4gudUC9-MPJX9tpEAYx4TQASns2E24ucuJ7rXJSL1BbEgf3vTwpmedCZkYa7Pulck7Xt7x_usFU2aIHOD4eEfVTVA5KMGUkqhNZV8_o5i",
+            "pending": 0,
             "results": [
                 {
                     "changes": [
@@ -227,7 +243,7 @@
                         }
                     ],
                     "id": "SpaghettiWithMeatballs",
-                    "seq": 38
+                    "seq":  "5-g1AAAAIReJyVkE0OgjAQRkcwUVceQU9g-mOpruQm2tI2SLCuXOtN9CZ6E70JFmpCCCFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloRid3MMkEUoJHbXbOxVy6arc_SxQWQzRVHCuYHaxSpuj1aqbj0t-3-AlSrZakn78oeSvjRSIkIhSNiCFHbsKN3c50b02mURvEB-yD296eNOzzoRMRLRZ98rkHS_veGcC_nR-fGe1gaCaxihhjOI2lX0BhniHaA"
                 }
             ]
         }
@@ -249,11 +265,11 @@ By default all changes are immediately returned within the JSON body::
 .. code-block:: javascript
 
     {"results":[
-    {"seq":1,"id":"fresh","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]},
-    {"seq":3,"id":"updated","changes":[{"rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}]},
-    {"seq":5,"id":"deleted","changes":[{"rev":"2-eec205a9d413992850a6e32678485900"}],"deleted":true}
+    {"seq":"1-g1AAAAF9eJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P__7MSGXAqSVIAkkn2IFUZzIkMuUAee5pRqnGiuXkKA2dpXkpqWmZeagpu_Q4g_fGEbEkAqaqH2sIItsXAyMjM2NgUUwdOU_JYgCRDA5ACGjQfn30QlQsgKvcTVnkAovI-YZUPICpBvs0CAN1eY_c","id":"fresh","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]},
+    {"seq":"3-g1AAAAG3eJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MSGXAqSVIAkkn2IFUZzIkMuUAee5pRqnGiuXkKA2dpXkpqWmZeagpu_Q4g_fGEbEkAqaqH2sIItsXAyMjM2NgUUwdOU_JYgCRDA5ACGjQfn30QlQsgKvcjfGaQZmaUmmZClM8gZhyAmHGfsG0PICrBPmQC22ZqbGRqamyIqSsLAAArcXo","id":"updated","changes":[{"rev":"2-7051cbe5c8faecd085a3fa619e6e6337CFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloRid3MMkEUoJHbXbOxVy6arc_SxQWQzRVHCuYHaxSpuj1aqbj0t-3-AlSrZakn78oeSvjRSIkIhSNiCFHbsKN3c50b02mURvEB-yD296eNOzzoRMRLRZ98rkHS_veGcC_nR-fGe1gaCaxihhjOI2lX0BhniHaA","id":"deleted","changes":[{"rev":"2-eec205a9d413992850a6e32678485900"}],"deleted":true}
     ],
-    "last_seq":5}
+    "last_seq":"5-g1AAAAIreJyVkEsKwjAURZ-toI5cgq5A0sQ0OrI70XyppcaRY92J7kR3ojupaSPUUgotgRd4yTlwbw4A0zRUMLdnpaMkwmyF3Ily9xBwEIuiKLI05KOTW0wkV4rruP29UyGWbordzwKVxWBNOGMKZhertDlarbr5pOT3DV4gudUC9-MPJX9tpEAYx4TQASns2E24ucuJ7rXJSL1BbEgf3vTwpmedCZkYa7Pulck7Xt7x_usFU2aIHOD4eEfVTVA5KMGUkqhNZV-8_o5i",
+    "pending": 0}
 
 ``results`` is the list of changes in sequential order. New and changed
 documents only differ in the value of the rev; deleted documents include the
@@ -262,16 +278,18 @@ only to the current/winning revision. The other revisions listed might
be
 deleted even if there is no deleted property; you have to ``GET`` them
 individually to make sure.)
 
-``last_seq`` is the sequence number of the last update returned. (Currently it
-will always be the same as the seq of the last item in results.)
+``last_seq`` is the update sequence of the last update returned (Equivalent
+to the last item in the results).
 
 Sending a ``since`` param in the query string skips all changes up to and
-including the given sequence number::
+including the given update sequence:
+
+.. code-block:: http
 
-    GET /somedatabase/_changes?since=3 HTTP/1.1
+    GET /somedatabase/_changes?since=4-g1AAAAHXeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBMZc4EC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HqQ_kQG3qgSQqnoUtxoYGZkZG5uS4NY8FiDJ0ACkgAbNx2cfROUCiMr9CJ8ZpJkZpaaZEOUziBkHIGbcJ2zbA4hKsA-ZwLaZGhuZmhobYurKAgCz33kh
HTTP/1.1
 
 The return structure for ``normal`` and ``longpoll`` modes is a JSON
-array of changes objects, and the last update sequence number.
+array of changes objects, and the last update sequence.
 
 In the return format for ``continuous`` mode, the server sends a ``CRLF``
 (carriage-return, linefeed) delimited line for each change. Each line
@@ -283,7 +301,8 @@ of just the change notification) by using the ``include_docs`` parameter.
 .. code-block:: javascript
 
     {
-        "last_seq": 5
+        "last_seq": "5-g1AAAAIreJyVkEsKwjAURZ-toI5cgq5A0sQ0OrI70XyppcaRY92J7kR3ojupaSPUUgotgRd4yTlwbw4A0zRUMLdnpaMkwmyF3Ily9xBwEIuiKLI05KOTW0wkV4rruP29UyGWbordzwKVxWBNOGMKZhertDlarbr5pOT3DV4gudUC9-MPJX9tpEAYx4TQASns2E24ucuJ7rXJSL1BbEgf3vTwpmedCZkYa7Pulck7Xt7x_usFU2aIHOD4eEfVTVA5KMGUkqhNZV-8_o5i",
+        "pending": 0,
         "results": [
             {
                 "changes": [
@@ -293,7 +312,7 @@ of just the change notification) by using the ``include_docs`` parameter.
                 ],
                 "deleted": true,
                 "id": "deleted",
-                "seq": 5,
+                "seq":  "5-g1AAAAIReJyVkE0OgjAQRkcwUVceQU9g-mOpruQm2tI2SLCuXOtN9CZ6E70JFmpCCCFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloRid3MMkEUoJHbXbOxVy6arc_SxQWQzRVHCuYHaxSpuj1aqbj0t-3-AlSrZakn78oeSvjRSIkIhSNiCFHbsKN3c50b02mURvEByD296eNOzzoRMRLRZ98rkHS_veGcC_nR-fGe1gaCaxihhjOI2lX0BhniHaA",
             }
         ]
     }
@@ -342,17 +361,16 @@ to simplify the job of the client - each line of the response is either
empty
 or a JSON object representing a single change, as found in the normal feed's
 results.
 
-.. code-block:: text
+.. code-block:: http
 
     GET /somedatabase/_changes?feed=continuous HTTP/1.1
 
 .. code-block:: javascript
 
-    {"seq":1,"id":"fresh","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]}
-    {"seq":3,"id":"updated","changes":[{"rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}]}
-    {"seq":5,"id":"deleted","changes":[{"rev":"2-eec205a9d413992850a6e32678485900"}],"deleted":true}
+    {"seq":"1-g1AAAAF9eJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MSGXAqSVIAkkn2IFUZzIkMuUAee5pRqnGiuXkKA2dpXkpqWmZeagpu_Q4g_fGEbEkAqaqH2sIItsXAyMjM2NgUUwdOU_JYgCRDA5ACGjQfn30QlQsgKvcTVnkAovI-YZUPICpBvs0CAN1eY_c","id":"fresh","changes":[{"rev":"5-g1AAAAHxeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBOZcoEC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HkV_kkGyZWqSEXH6E0D666H6GcH6DYyMzIyNTUnwRR4LkGRoAFJAg-YjwiMtOdXCwJyU8ICYtABi0n6EnwzSzIxS00yI8hPEjAMQM-5nJTIQUPkAovI_UGUWAA0SgOI","id":"updated","changes":[{"rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}]}
+    {"seq":"3-g1AAAAHReJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBOZcoEC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HkV_kkGyZWqSEXH6E0D660H6ExlwqspjAZIMDUAKqHA-yCZGiEuTUy0MzEnxL8SkBRCT9iPcbJBmZpSaZkKUmyFmHICYcZ-wux9AVIJ8mAUABgp6XQ","id":"deleted","changes":[{"rev":"2-eec205a9d413992850a6e32678485900"}],"deleted":true}
     ... tum tee tum ...
-    {"seq":6,"id":"updated","changes":[{"rev":"3-825cb35de44c433bfb2df415563a19de"}]}
+    {"seq":"6-g1AAAAIreJyVkEsKwjAURWMrqCOXoCuQ9MU0OrI70XyppcaRY92J7kR3ojupaVNopRQsgRd4yTlwb44QmqahQnN7VjpKImAr7E6Uu4eAI7EoiiJLQx6c3GIiuVJcx93vvQqxdFPsaguqLAY04YwpNLtYpc3RatXPJyW__-EFllst4D_-UPLXmh9VPAaICaEDUtixm-jmLie6N30YqTeYDenDmx7e9GwyYRODNuu_MnnHyzverV6AMkPkAMfHO1rdUAKUkqhLZV-_0o5j","id":"updated","changes":[{"rev":"3-825cb35de44c433bfb2df415563a19de"}]}
 
 Obviously, `... tum tee tum ...` does not appear in the actual response, but
 represents a long pause before the change with seq 6 occurred.
@@ -369,7 +387,7 @@ the form of DOM events in the browser. Refer to the `W3C eventsource
 specification`_ for further details. CouchDB also honours the ``Last-Event-ID``
 parameter.
 
-.. code-block:: text
+.. code-block:: http
 
     GET /somedatabase/_changes?feed=eventsource HTTP/1.1
 
@@ -448,6 +466,83 @@ This filter accepts only changes for documents which ID in specified
in
 ``doc_ids`` query parameter or payload's object array. See
 :post:`/{db}/_changes` for an example.
 
+.. _changes/filter/selector:
+
+_selector
+---------
+
+.. versionadded:: 2.0
+
+This filter accepts only changes for documents which match a specified
+selector, defined using the same :ref:`selector
+syntax <find/selectors>` used for :ref:`_find <api/db/_find>`.
+
+This is more significantly more efficient than using a JavaScript filter
+function and is the recommended option if filtering on document attributes only.
+
+Note that, unlike JavaScript filters, selectors do not have access to the
+request object.
+
+**Request**:
+
+.. code-block:: http
+
+    POST /recipes/_changes?filter=_selector HTTP/1.1
+    Content-Type: application/json
+    Host: localhost:5984
+
+    {
+        "selector": { "_id": { "$regex": "^_design/" } }
+    }
+
+**Response**:
+
+.. code-block:: http
+
+    HTTP/1.1 200 OK
+    Cache-Control: must-revalidate
+    Content-Type: application/json
+    Date: Tue, 06 Sep 2016 20:03:23 GMT
+    Etag: "1H8RGBCK3ABY6ACDM7ZSC30QK"
+    Server: CouchDB (Erlang OTP/18)
+    Transfer-Encoding: chunked
+
+    {
+        "last_seq": "11-g1AAAAIreJyVkEEKwjAQRUOrqCuPoCeQZGIaXdmbaNIk1FLjyrXeRG-iN9Gb1LQRaimFlsAEJnkP_s8RQtM0VGhuz0qTmABfYXdI7h4CgeSiKIosDUVwcotJIpQSOmp_71TIpZty97OgymJAU8G5QrOLVdocrVbdfFzy-wYvcbLVEvrxh5K_NlJggIhSNiCFHbmJbu5yonttMoneYD6kD296eNOzzoRNBNqse2Xyjpd3vP96AcYNTQY4Pt5RdTOuHIwCY5S0qewLwY6OaA",
+        "pending": 0,
+        "results": [
+            {
+                "changes": [
+                    {
+                        "rev": "10-304cae84fd862832ea9814f02920d4b2"
+                    }
+                ],
+                "id": "_design/ingredients",
+                "seq": "8-g1AAAAHxeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBOZcoEC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HkV_kkGyZWqSEXH6E0D666H6GcH6DYyMzIyNTUnwRR4LkGRoAFJAg-ZnJTIQULkAonI_ws0GaWZGqWkmRLkZYsYBiBn3Cdv2AKIS7ENWsG2mxkampsaGmLqyAOYpgEo"
+            },
+            {
+                "changes": [
+                    {
+                        "rev": "123-6f7c1b7c97a9e4f0d22bdf130e8fd817"
+                    }
+                ],
+                "deleted": true,
+                "id": "_design/cookbook",
+                "seq": "9-g1AAAAHxeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBOZcoEC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HkV_kkGyZWqSEXH6E0D661F8YWBkZGZsbEqCL_JYgCRDA5ACGjQ_K5GBgMoFEJX7EW42SDMzSk0zIcrNEDMOQMy4T9i2BxCVYB-ygm0zNTYyNTU2xNSVBQDnK4BL"
+            },
+            {
+                "changes": [
+                    {
+                        "rev": "6-5b8a52c22580e922e792047cff3618f3"
+                    }
+                ],
+                "deleted": true,
+                "id": "_design/meta",
+                "seq": "11-g1AAAAIReJyVkE0OgjAQRiegUVceQU9g-mOpruQm2tI2SLCuXOtN9CZ6E70JFmpCCCFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloQhO7mGSCKWEjtrtnQq5dFXufhaoLIZoKjhXMLtYpc3RatXNxyW_b_ASJVstST_-UPLXRgpESEQpG5DCjlyFm7uc6F6bTKI3iA_Zhzc9vOlZZ0ImItqse2Xyjpd3vDMBfzo_vrPawLiaxihhjOI2lX0BirqHbg"
+            }
+        ]
+    }
+
 .. _changes/filter/design:
 
 _design
@@ -471,13 +566,14 @@ requested database.
     HTTP/1.1 200 OK
     Cache-Control: must-revalidate
     Content-Type: application/json
-    Date: Sat, 28 Sep 2013 07:28:28 GMT
+    Date: Tue, 06 Sep 2016 12:55:12 GMT
     ETag: "ARIHFWL3I7PIS0SPVTFU6TLR2"
     Server: CouchDB (Erlang OTP)
     Transfer-Encoding: chunked
 
     {
-        "last_seq": 38,
+        "last_seq": "11-g1AAAAIreJyVkEEKwjAQRUOrqCuPoCeQZGIaXdmbaNIk1FLjyrXeRG-iN9Gb1LQRaimFlsAEJnkP_s8RQtM0VGhuz0qTmABfYXdI7h4CgeSiKIosDUVwcotJIpQSOmp_71TIpZty97OgymJAU8G5QrOLVdocrVbdfFzy-wYvcbLVEvrxh5K_NlJggIhSNiCFHbmJbu5yonttMoneYD6kD296eNOzzoRNBNqse2Xyjpd3vP96AcYNTQY4Pt5RdTOuHIwCY5S0qewLwY6OaA",
+        "pending": 0,
         "results": [
             {
                 "changes": [
@@ -486,7 +582,7 @@ requested database.
                     }
                 ],
                 "id": "_design/ingredients",
-                "seq": 29
+                "seq": "8-g1AAAAHxeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBOZcoEC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HkV_kkGyZWqSEXH6E0D666H6GcH6DYyMzIyNTUnwRR4LkGRoAFJAg-ZnJTIQULkAonI_ws0GaWZGqWkmRLkZYsYBiBn3Cdv2AKIS7ENWsG2mxkampsaGmLqyAOYpgEo"
             },
             {
                 "changes": [
@@ -496,7 +592,7 @@ requested database.
                 ],
                 "deleted": true,
                 "id": "_design/cookbook",
-                "seq": 35
+                "seq": "9-g1AAAAHxeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBOZcoEC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HkV_kkGyZWqSEXH6E0D661F8YWBkZGZsbEqCL_JYgCRDA5ACGjQ_K5GBgMoFEJX7EW42SDMzSk0zIcrNEDMOQMy4T9i2BxCVYB-ygm0zNTYyNTU2xNSVBQDnK4BL"
             },
             {
                 "changes": [
@@ -506,7 +602,7 @@ requested database.
                 ],
                 "deleted": true,
                 "id": "_design/meta",
-                "seq": 36
+                "seq": "11-g1AAAAIReJyVkE0OgjAQRiegUVceQU9g-mOpruQm2tI2SLCuXOtN9CZ6E70JFmpCCCFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloQhO7mGSCKWEjtrtnQq5dFXufhaoLIZoKjhXMLtYpc3RatXNxyW_b_ASJVstST_-UPLXRgpESEQpG5DCjlyFm7uc6F6bTKI3iA_Zhzc9vOlZZ0ImItqse2Xyjpd3vDMBfzo_vrPawLiaxihhjOI2lX0BirqHbg"
             }
         ]
     }
@@ -557,13 +653,13 @@ amount of duplicated code.
     HTTP/1.1 200 OK
     Cache-Control: must-revalidate
     Content-Type: application/json
-    Date: Sat, 28 Sep 2013 07:36:40 GMT
+    Date: Tue, 06 Sep 2016 12:57:56 GMT
     ETag: "ARIHFWL3I7PIS0SPVTFU6TLR2"
     Server: CouchDB (Erlang OTP)
     Transfer-Encoding: chunked
 
     {
-        "last_seq": 38,
+        "last_seq": "11-g1AAAAIreJyVkEEKwjAQRUOrqCuPoCeQZGIaXdmbaNIk1FLjyrXeRG-iN9Gb1LQRaimFlsAEJnkP_s8RQtM0VGhuz0qTmABfYXdI7h4CgeSiKIosDUVwcotJIpQSOmp_71TIpZty97OgymJAU8G5QrOLVdocrVbdfFzy-wYvcbLVEvrxh5K_NlJggIhSNiCFHbmJbu5yonttMoneYD6kD296eNOzzoRNBNqse2Xyjpd3vP96AcYNTQY4Pt5RdTOuHIwCY5S0qewLwY6OaA",
         "results": [
             {
                 "changes": [
@@ -572,7 +668,7 @@ amount of duplicated code.
                     }
                 ],
                 "id": "SpaghettiWithMeatballs",
-                "seq": 38
+                "seq": "11-g1AAAAIReJyVkE0OgjAQRiegUVceQU9g-mOpruQm2tI2SLCuXOtN9CZ6E70JFmpCCCFCmkyTdt6bfJMDwDQNFcztWWkcY8JXyB2cu49AgFwURZGloQhO7mGSCKWEjtrtnQq5dFXufhaoLIZoKjhXMLtYpc3RatXNxyW_b_ASJVstST_-UPLXRgpESEQpG5DCjlyFm7uc6F6bTKI3iA_Zhzc9vOlZZ0ImItqse2Xyjpd3vDMBfzo_vrPawLiaxihhjOI2lX0BirqHbg"
             }
         ]
     }

http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/162b7a0c/src/couchapp/ddocs.rst
----------------------------------------------------------------------
diff --git a/src/couchapp/ddocs.rst b/src/couchapp/ddocs.rst
index 5c68e6b..ac3ffae 100644
--- a/src/couchapp/ddocs.rst
+++ b/src/couchapp/ddocs.rst
@@ -484,12 +484,12 @@ if you apply this function to the changes feed it will emit only changes
about
 .. code-block:: javascript
 
     {"results":[
-    {"seq":1,"id":"df8eca9da37dade42ee4d7aa3401f1dd","changes":[{"rev":"1-c2e0085a21d34fa1cecb6dc26a4ae657"}]},
-    {"seq":7,"id":"df8eca9da37dade42ee4d7aa34024714","changes":[{"rev":"1-29d748a6e87b43db967fe338bcb08d74"}]},
+    {"seq":"1-g1AAAAF9eJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBMZc4EC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HqQ_kQG3qgSQqnoCqvJYgCRDA5ACKpxPWOUCiMr9hFUegKi8T1jlA4hKkDuzAC2yZRo","id":"df8eca9da37dade42ee4d7aa3401f1dd","changes":[{"rev":"1-c2e0085a21d34fa1cecb6dc26a4ae657"}]},
+    {"seq":"9-g1AAAAIreJyVkEsKwjAURUMrqCOXoCuQ5MU0OrI70XyppcaRY92J7kR3ojupaSPUUgqWwAu85By4t0AITbJYo5k7aUNSAnyJ_SGFf4gEkvOyLPMsFtHRL8ZKaC1M0v3eq5ALP-X2a0G1xYKhgnONpmenjT04o_v5tOJ3LV5itTES_uP3FX9ppcAACaVsQAo38hNd_eVFt8ZklVljPqSPYLoH06PJhG0Cxq7-yhQcz-B4_fQCjFuqBjjewVF3E9cORoExSrpU_gHBTo5m","id":"df8eca9da37dade42ee4d7aa34024714","changes":[{"rev":"1-29d748a6e87b43db967fe338bcb08d74"}]},
     ],
-    "last_seq":27}
+    "last_seq":"10-g1AAAAIreJyVkEsKwjAURR9tQR25BF2B5GMaHdmdaNIk1FLjyLHuRHeiO9Gd1LQRaimFlsALvOQcuLcAgGkWKpjbs9I4wYSvkDu4cA-BALkoyzLPQhGc3GKSCqWEjrvfexVy6abc_SxQWwzRVHCuYHaxSpuj1aqfTyp-3-IlSrdakmH8oeKvrRSIkJhSNiKFjdyEm7uc6N6YTKo3iI_pw5se3vRsMiETE23WgzJ5x8s73n-9EMYNTUc4Pt5RdxPVDkYJYxR3qfwLwW6OZw"}
 
-Note that the value of ``last_seq`` is 27, but we received only two records.
+Note that the value of ``last_seq`` is `10-..`, but we received only two records.
 Seems like any other changes were for documents that haven't passed our filter.
 
 We probably need to filter the changes feed of our mailbox by more than a single
@@ -526,10 +526,10 @@ filter match only the required documents::
 .. code-block:: javascript
 
     {"results":[
-    {"seq":1,"id":"df8eca9da37dade42ee4d7aa3401f1dd","changes":[{"rev":"1-c2e0085a21d34fa1cecb6dc26a4ae657"}]},
-    {"seq":7,"id":"df8eca9da37dade42ee4d7aa34024714","changes":[{"rev":"1-29d748a6e87b43db967fe338bcb08d74"}]},
+    {"seq":"1-g1AAAAF9eJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBMZc4EC7MmJKSmJqWaYynEakaQAJJPsoaYwgE1JM0o1TjQ3T2HgLM1LSU3LzEtNwa3fAaQ_HqQ_kQG3qgSQqnoCqvJYgCRDA5ACKpxPWOUCiMr9hFUegKi8T1jlA4hKkDuzAC2yZRo","id":"df8eca9da37dade42ee4d7aa3401f1dd","changes":[{"rev":"1-c2e0085a21d34fa1cecb6dc26a4ae657"}]},
+    {"seq":"9-g1AAAAIreJyVkEsKwjAURUMrqCOXoCuQ5MU0OrI70XyppcaRY92J7kR3ojupaSPUUgqWwAu85By4t0AITbJYo5k7aUNSAnyJ_SGFf4gEkvOyLPMsFtHRL8ZKaC1M0v3eq5ALP-X2a0G1xYKhgnONpmenjT04o_v5tOJ3LV5itTES_uP3FX9ppcAACaVsQAo38hNd_eVFt8ZklVljPqSPYLoH06PJhG0Cxq7-yhQcz-B4_fQCjFuqBjjewVF3E9cORoExSrpU_gHBTo5m","id":"df8eca9da37dade42ee4d7aa34024714","changes":[{"rev":"1-29d748a6e87b43db967fe338bcb08d74"}]},
     ],
-    "last_seq":27}
+    "last_seq":"10-g1AAAAIreJyVkEsKwjAURR9tQR25BF2B5GMaHdmdaNIk1FLjyLHuRHeiO9Gd1LQRaimFlsALvOQcuLcAgGkWKpjbs9I4wYSvkDu4cA-BALkoyzLPQhGc3GKSCqWEjrvfexVy6abc_SxQWwzRVHCuYHaxSpuj1aqfTyp-3-IlSrdakmH8oeKvrRSIkJhSNiKFjdyEm7uc6N6YTKo3iI_pw5se3vRsMiETE23WgzJ5x8s73n-9EMYNTUc4Pt5RdxPVDkYJYxR3qfwLwW6OZw"}
 
 and we can easily change filter behavior with::
 
@@ -538,9 +538,9 @@ and we can easily change filter behavior with::
 .. code-block:: javascript
 
     {"results":[
-    {"seq":11,"id":"8960e91220798fc9f9d29d24ed612e0d","changes":[{"rev":"3-cc6ff71af716ddc2ba114967025c0ee0"}]},
+    {"seq":"6-g1AAAAIreJyVkM0JwjAYQD9bQT05gk4gaWIaPdlNNL_UUuPJs26im-gmuklMjVClFFoCXyDJe_BSAsA4jxVM7VHpJEswWyC_ktJfRBzEzDlX5DGPDv5gJLlSXKfN560KMfdTbL4W-FgM1oQzpmByskqbvdWqnc8qfvvHCyTXWuBu_K7iz38VCOOUENqjwg79hIvfvOhamQahROoVYn3-I5huwXSvm5BJsTbLTk3B8QiO58-_YMoMkT0cr-BwdRElmFKSNKniDcAcjmM","id":"8960e91220798fc9f9d29d24ed612e0d","changes":[{"rev":"3-cc6ff71af716ddc2ba114967025c0ee0"}]},
     ],
-    "last_seq":27}
+    "last_seq":"10-g1AAAAIreJyVkEsKwjAURR9tQR25BF2B5GMaHdmdaNIk1FLjyLHuRHeiO9Gd1LQRaimFlsALvOQcuLcAgGkWKpjbs9I4wYSvkDu4cA-BALkoyzLPQhGc3GKSCqWEjrvfexVy6abc_SxQWwzRVHCuYHaxSpuj1aqfTyp-3-IlSrdakmH8oeKvrRSIkJhSNiKFjdyEm7uc6N6YTKo3iI_pw5se3vRsMiETE23WgzJ5x8s73n-9EMYNTUc4Pt5RdxPVDkYJYxR3qfwLwW6OZw"}
 
 Combining filters with a `continuous` feed allows creating powerful event-driven
 systems.

http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/162b7a0c/src/json-structure.rst
----------------------------------------------------------------------
diff --git a/src/json-structure.rst b/src/json-structure.rst
index 6075120..bf84f61 100644
--- a/src/json-structure.rst
+++ b/src/json-structure.rst
@@ -72,11 +72,13 @@ Changes information for a database
 +--------------------------------+---------------------------------------------+
 | Field                          | Description                                 |
 +================================+=============================================+
-| last_seq                       | Last change sequence number                 |
+| last_seq                       | Last update sequence                        |
++--------------------------------+---------------------------------------------+
+| pending                        | Count of remaining items in the feed        |
 +--------------------------------+---------------------------------------------+
 | results [array]                | Changes made to a database                  |
 +--------------------------------+---------------------------------------------+
-|         seq                    | Update sequence number                      |
+|         seq                    | Update sequence                             |
 +--------------------------------+---------------------------------------------+
 |         id                     | Document ID                                 |
 +--------------------------------+---------------------------------------------+


Mime
View raw message