From commits-return-7353-apmail-couchdb-commits-archive=couchdb.apache.org@couchdb.apache.org Wed Nov 23 12:26:57 2011 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 AB4217372 for ; Wed, 23 Nov 2011 12:26:57 +0000 (UTC) Received: (qmail 54290 invoked by uid 500); 23 Nov 2011 12:26:57 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 54251 invoked by uid 500); 23 Nov 2011 12:26:57 -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 54244 invoked by uid 500); 23 Nov 2011 12:26:57 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 54241 invoked by uid 99); 23 Nov 2011 12:26:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 12:26:57 +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, 23 Nov 2011 12:26:55 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 28880AE3; Wed, 23 Nov 2011 12:26:34 +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, 23 Nov 2011 12:26:34 -0000 Message-ID: <20111123122634.55005.57714@eos.apache.org> Subject: =?utf-8?q?=5BCouchdb_Wiki=5D_Update_of_=22HTTP=5FDocument=5FAPI=22_by_Rob?= =?utf-8?q?ertNewson?= 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 RobertNewson: http://wiki.apache.org/couchdb/HTTP_Document_API?action=3Ddiff&rev1=3D79&re= v2=3D80 Comment: Remove mention of _all_docs_by_seq (obsolete) }}} If you add ''include_docs=3Dtrue'' to a request to ''_all_docs'' not only= metadata but also the documents themselves are returned. = + =3D=3D=3D _changes =3D=3D=3D - =3D=3D=3D all_docs_by_seq =3D=3D=3D - NOTE: See [[HTTP_database_API#Changes|/database/_changes]] as of 0.11 = This allows you to see all the documents that were updated and deleted, i= n the order these actions are done: = {{{ - GET somedatabase/_all_docs_by_seq HTTP/1.0 + GET somedatabase/_changes HTTP/1.0 }}} Will return: = @@ -433, +432 @@ ] } }}} - All the view parameters work on _all_docs_by_seq, such as startkey, inclu= de_docs etc. However, note that the startkey is exclusive when applied to t= his view. This allows for a usage pattern where the startkey is set to the = sequence id of the last doc returned by the previous query. As the startkey= is exclusive, the same document won't be processed twice. + All the view parameters work on _changes, such as startkey, include_docs = etc. However, note that the startkey is exclusive when applied to this view= . This allows for a usage pattern where the startkey is set to the sequence= id of the last doc returned by the previous query. As the startkey is excl= usive, the same document won't be processed twice. + = + See [[HTTP_database_API#Changes|/database/_changes]] for more details. = =3D=3D Attachments =3D=3D Documents can have attachments just like email. There are two ways to use= attachments. The first one is inline with your document and it described f= irst. The second one is a separate REST API for attachments that is describ= ed a little further down.