couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jedediah Smith <jeded...@silencegreys.com>
Subject Re: threaded email view
Date Fri, 28 Nov 2008 01:32:06 GMT

This works if emails always list all of their ancestors in the 
references field. If that is indeed the case then I wasn't aware of it 
and it certainly makes my task simpler.

I am however still interested in the case where nodes of a data 
structure only link to their immediate parent, just or the sake of 
discussion.

Thomas Kerpe wrote:
> Hoops, sorry for that html and broken Text-part:
> 
> function(doc) {
>   if (doc.type == "email") {
>     thread = [];
>     if (doc.header.references){
>       thread = doc.header.references.split(" ");
>     }
>     thread.push(doc.header['message-id']);
>     thread_id = thread[0];
>     emit([thread_id, thread,], doc.header.subject);
>   }
> }
> 
> //Thomas

Mime
View raw message