couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Thayer <...@cloudant.com>
Subject Re: how to get last id changed.
Date Mon, 19 Aug 2013 19:44:05 GMT
Hey Souza!

If you want to find the most recent id, you can use the `_changes` feed as
described in this
thread.<http://stackoverflow.com/questions/9591659/how-to-get-last-created-document-in-couchdb>
So
for example, you could make a GET request
against "/{database}/_changes?descending=true&limit=1" to get the most
recent doc, where {database} is whatever database you're using.

"descending=true" gives you the list starting with the most recent change,
and "limit=1" limits the response to only the first change -- that is, the
most recent one.

Does that help?

Best regards,
Max <http://www.maxthayer.org/>


On Mon, Aug 19, 2013 at 2:13 PM, souza.davirs <souza.davirs@gmail.com>wrote:

> so, I looked at the link and  and found update_seq, but I'm now starting
> with
> couchdb and do not know how to use update_seq in my view, could give me an
> example?
>
> Thank you.
>
>
>
> --
> View this message in context:
> http://couchdb-development.1959287.n2.nabble.com/how-to-get-last-id-changed-tp7586830p7586833.html
> Sent from the CouchDB Development mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message