incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: CouchDB: Most recently added document that is NOT a design document
Date Tue, 07 Jan 2014 00:53:07 GMT

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’s still going to return documents by order modified, not created.

I think you mean “generation number”, not “seq number”, as only the first document
ever added to the db will have a sequence number of 1. And you’ll only see a generation
number of 1 if the doc’s never been updated after the initial add, so this isn’t 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’s not really any different. They appear in the _changes feed just as local changes do.

View raw message