Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 074257AF6 for ; Wed, 7 Dec 2011 23:27:24 +0000 (UTC) Received: (qmail 65943 invoked by uid 500); 7 Dec 2011 23:27:23 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 65901 invoked by uid 500); 7 Dec 2011 23:27:23 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 65894 invoked by uid 500); 7 Dec 2011 23:27:23 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 65889 invoked by uid 99); 7 Dec 2011 23:27:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 23:27:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 23:17:45 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 71187208; Wed, 7 Dec 2011 23:17:23 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Wed, 07 Dec 2011 23:17:23 -0000 Message-ID: <20111207231723.84409.59196@eos.apache.org> Subject: =?utf-8?q?=5BCouchdb_Wiki=5D_Update_of_=22HTTP=5FDocument=5FAPI=22_by_Jen?= =?utf-8?q?sAlfke?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for c= hange notification. The "HTTP_Document_API" page has been changed by JensAlfke: http://wiki.apache.org/couchdb/HTTP_Document_API?action=3Ddiff&rev1=3D83&re= v2=3D84 Comment: Added documentation of _revisions field. ||''_rev'' ||The current MVCC-token/revision of this document ('''mandato= ry''' and '''immutable''') || ||''_attachments'' ||If the document has attachments, _attachments holds = a (meta-)data structure (see section on [[HTTP_Document_API#Attachments]]) = || ||''_deleted'' ||Indicates that this document has been deleted and previo= us revisions will be removed on next compaction run || + ||''_revisions'' ||Revision history of the document || ||''_revs_info'' ||A list of revisions of the document, and their availab= ility || ||''_conflicts'' ||Information about conflicts || ||''_deleted_conflicts'' ||Information about conflicts || @@ -123, +124 @@ {{{ { "_revs_info": [ - {"rev": "123456", "status": "available"}, + {"rev": "3-ffffff", "status": "available"}, - {"rev": "234567", "status": "missing"}, + {"rev": "2-eeeeee", "status": "missing"}, - {"rev": "345678", "status": "deleted"}, + {"rev": "1-dddddd", "status": "deleted"}, ] } }}} Here, ''available'' means the revision content is stored in the database = and can still be retrieved. The other values indicate that the content of t= hat revision is not available. + = + Alternatively, the {{{_revisions}}} field, used by the replicator, can re= turn an array of revision IDs more efficiently. The numeric prefixes are re= moved, with a "start" value indicating the prefix for the first (most recen= t) ID: + = + {{{ + { + "_revisions": { + "start": 3, + "ids": ["fffff", "eeeee", "ddddd"] + } + } + }}} = You can fetch the bodies of multiple revisions at once using the paramete= r `open_revs=3D["rev1","rev2",...]`, or you can fetch all leaf revisions us= ing `open_revs=3Dall` (see [[Replication_and_conflicts]]). The JSON returns= an array of objects with an "ok" key pointing to the document, or a "missi= ng" key pointing to the rev string. =20