incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Iriele <siriele...@gmail.com>
Subject Re: CouchDB: Most recently added document that is NOT a design document
Date Mon, 06 Jan 2014 22:00:58 GMT
Could you do what Jens just mentioned and just make a filter?....that way a
seq number plus the filter should get you what you want
On Jan 6, 2014 1:28 PM, "Jens Alfke" <jens@couchbase.com> wrote:

>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message