couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saq Imtiaz <lew...@gmail.com>
Subject Re: Implementing next and previous links
Date Tue, 02 Mar 2010 22:28:30 GMT
Hi Dave,

Its an interesting idea and one that I had considered briefly. The issue
here would be that if a post was updated, added or deleted in the middle of
a sequence the next and previous attributes for all affected documents would
need to be updated. This should be an infrequent enough operation that
performance should not be an issue... and it could be handled by the
clientside code responsible for allowing creation of new docs. OK I must
confess I'm a little unsure as to whether I rejected this approach so
quickly before. Thinking of a doubly-linked list had left a bad taste in my
mouth at first but it might be more convenient than the other approaches
I've discussed... using include_docs we could even get access to the next
and previous docs if necessary. Late here now so will sleep on it but
there's a good chance I'll try going down this road.
Cheers,
Saq

On Tue, Mar 2, 2010 at 22:56, David Goodlad <david@goodlad.ca> wrote:

>
> >  What I haven't found a way to do is end up with a /date/docid/ type of
> URL
> > for the previous post where the date and docid are both attributes of
> that
> > previous post. Unless I've missed something significant the _rewrite
> handler
> > can't do this as it provides simple mapping between different URL paths
> and
> > can't perform any queries to the database to determine the appropriate
> > document id for instance.
>
> Why not reference the next and previous docids within the doc itself
> (ie: a doubly-linked list)?
>
> Dave
>

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