You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Moritz Post <mo...@gmail.com> on 2010/06/04 16:08:03 UTC
Find latest document by timestamp
Hi CouchPeople
That might be an easy one but i can't figure it out just yet.
I have a set of documents, all created at different points in time as
taged by a stimestamp (in UNIX format). How can i now get the very
latest of these documents?
Thanks for any help.
Greets
Moritz Post
Re: Find latest document by timestamp
Posted by Moritz Post <mo...@gmail.com>.
Thanks you two. That was more easy than what i tried.
Since my timestamps are raw numbers collation shouldn't be a problem.
Thanks again.
Moritz
On Fri, Jun 4, 2010 at 4:42 PM, Alex P <ko...@gmail.com> wrote:
> Just be sure to check that your timestamps get collated correctly.
>
> On Jun 4, 2010, at 9:22 AM, Sebastian Cohnen
> <se...@googlemail.com> wrote:
>
>> create a view, emit the timestamp and query the view with descending=true
>> and limit=1 (see
>> http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options)
>>
>> On 04.06.2010, at 16:08, Moritz Post wrote:
>>
>>> Hi CouchPeople
>>>
>>> That might be an easy one but i can't figure it out just yet.
>>>
>>> I have a set of documents, all created at different points in time as
>>> taged by a stimestamp (in UNIX format). How can i now get the very
>>> latest of these documents?
>>>
>>> Thanks for any help.
>>>
>>> Greets
>>> Moritz Post
>>
>
Re: Find latest document by timestamp
Posted by Alex P <ko...@gmail.com>.
Just be sure to check that your timestamps get collated correctly.
On Jun 4, 2010, at 9:22 AM, Sebastian Cohnen <sebastiancohnen@googlemail.com
> wrote:
> create a view, emit the timestamp and query the view with
> descending=true and limit=1 (see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
> )
>
> On 04.06.2010, at 16:08, Moritz Post wrote:
>
>> Hi CouchPeople
>>
>> That might be an easy one but i can't figure it out just yet.
>>
>> I have a set of documents, all created at different points in time as
>> taged by a stimestamp (in UNIX format). How can i now get the very
>> latest of these documents?
>>
>> Thanks for any help.
>>
>> Greets
>> Moritz Post
>
Re: Find latest document by timestamp
Posted by Sebastian Cohnen <se...@googlemail.com>.
create a view, emit the timestamp and query the view with descending=true and limit=1 (see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options)
On 04.06.2010, at 16:08, Moritz Post wrote:
> Hi CouchPeople
>
> That might be an easy one but i can't figure it out just yet.
>
> I have a set of documents, all created at different points in time as
> taged by a stimestamp (in UNIX format). How can i now get the very
> latest of these documents?
>
> Thanks for any help.
>
> Greets
> Moritz Post