Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 85012 invoked from network); 2 Mar 2010 22:29:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Mar 2010 22:29:06 -0000 Received: (qmail 17263 invoked by uid 500); 2 Mar 2010 22:29:00 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17124 invoked by uid 500); 2 Mar 2010 22:29:00 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 17116 invoked by uid 99); 2 Mar 2010 22:29:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 22:29:00 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lewcid@gmail.com designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pw0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 22:28:51 +0000 Received: by pwi10 with SMTP id 10so483768pwi.11 for ; Tue, 02 Mar 2010 14:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=V3yycikBfG53+GcSz4tPbibshmFgAL7wHiySTAdkscI=; b=RoAGhZ59tYaYWG+SpyJ8I+hokkdtWPnTuwHvxHBDRJwAyLEIUx9BUF5spkP3cXXhHm kjSWdqZy3XDlaajc/DR2w53p9Kkcp8KN4wwfC93jOI8cpzIWT38pAdy5BsMszIyjigIb 7plPgBV7Fno0uQ91wIQlgKVtyRWCwdurxjH1A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=v0mD1ay1vlRBOxUXHhjBhnc6sjpiXo/uEuCdud4AHAff89Ru2Ht/F9S0zUgeqSyHGa s8+8iAXhvinVn7dFNUqE2pGJ22wGcrEfWdw32B9I8Q5Spe4YK97Ugc+bYFnVLj0jIzcd zWwno4egL253URtaJhbE2JO927AjqZtwiQVRE= MIME-Version: 1.0 Received: by 10.141.108.8 with SMTP id k8mr549465rvm.102.1267568910119; Tue, 02 Mar 2010 14:28:30 -0800 (PST) In-Reply-To: <594289661003021356k1dd980d6gb507c50bc6eb707c@mail.gmail.com> References: <21a5a18d1003021103m466b3363p9c549e25792f72af@mail.gmail.com> <3A7E9A0D-0535-4B36-831E-6AB88A526F2A@gmail.com> <594289661003021356k1dd980d6gb507c50bc6eb707c@mail.gmail.com> Date: Tue, 2 Mar 2010 23:28:30 +0100 Message-ID: Subject: Re: Implementing next and previous links From: Saq Imtiaz To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd13ac29db4910480d8e2b5 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd13ac29db4910480d8e2b5 Content-Type: text/plain; charset=ISO-8859-1 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 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 > --000e0cd13ac29db4910480d8e2b5--