couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject Re: CouchDB: Most recently added document that is NOT a design document
Date Mon, 06 Jan 2014 21:27:32 GMT

On Jan 6, 2014, at 12:42 PM, Hank Knight <hknight555@gmail.com> wrote:

> I want the ID of the most recently added document that is NOT a design
> document.

There’s nothing built-in for that. CouchDB doesn’t track the order in which documents
are created, only the order in which they’re changed.

You could put a “date_created” property in a document and populate it with a timestamp
when the doc is first created; then you can make a view that emits those as keys, and query
it in reverse order.

—Jens
Mime
View raw message