Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2348910ADF for ; Tue, 7 Jan 2014 00:53:39 +0000 (UTC) Received: (qmail 41978 invoked by uid 500); 7 Jan 2014 00:53:37 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41908 invoked by uid 500); 7 Jan 2014 00:53:37 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 41900 invoked by uid 99); 7 Jan 2014 00:53:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jan 2014 00:53:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jens@couchbase.com designates 206.225.164.31 as permitted sender) Received: from [206.225.164.31] (HELO EXHUB020-4.exch020.serverdata.net) (206.225.164.31) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jan 2014 00:53:32 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.179]) by EXHUB020-4.exch020.serverdata.net ([206.225.164.31]) with mapi; Mon, 6 Jan 2014 16:53:10 -0800 From: Jens Alfke To: "user@couchdb.apache.org" Date: Mon, 6 Jan 2014 16:53:07 -0800 Subject: Re: CouchDB: Most recently added document that is NOT a design document Thread-Topic: CouchDB: Most recently added document that is NOT a design document Thread-Index: Ac8LQtWwOxBAeCqgTraCrgIZVhBHgQ== Message-ID: <5AFB30EB-D329-4B9A-8A0B-FD889606EA81@couchbase.com> References: <52CB474A.9060202@systemli.org> In-Reply-To: <52CB474A.9060202@systemli.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On Jan 6, 2014, at 4:16 PM, Lars wrote: > It might depend on your definition of "added document". If `PUT > /db/docid` and `POST /db` are the only ways to "add", then do what Bob > said and stop at the first non-design document with a seq number of 1. That=92s still going to return documents by order modified, not created. I think you mean =93generation number=94, not =93seq number=94, as only the= first document ever added to the db will have a sequence number of 1. And = you=92ll only see a generation number of 1 if the doc=92s never been update= d after the initial add, so this isn=92t useful in the general case. > It starts getting tricky if you also include in your definition > documents that are created by replication, and I'm not sure how to > handle that. It=92s not really any different. They appear in the _changes feed just as l= ocal changes do. =97Jens=