incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajkumar S <rajkum...@gmail.com>
Subject map from multiple docs
Date Thu, 17 Dec 2009 15:25:05 GMT
Hello,

I have a db which stores mail logs. Each log entry is stored as a
single document. for example (just the relevant fields):

{
   "_id": "2b93d795d483b1ca352f6596c5497c7f",
   "_rev": "1-1463054967",
   "queueid": "03DBB81E1F",
   "numrecipients": 1,
   "fromemail": "officefile631@yahoo.com",
   "logtype": "message_from"
}

{
   "_id": "5ade1602d52f75a4b35ab6c03aa5d8d9",
   "_rev": "1-2573414463",
   "queueid": "03DBB81E1F",
   "rcptemail": "joe@swinepro.info",
   "logtype": "message_delivery",
}

I want to get the queueid of all mails sent from yahoo.com domain to
swinepro.info domain.

If all entries with same queueid was in the same doc I can write a map
with key like ["yahoo.com","swinepro.info"] so that in my url I just
use startkey as ["yahoo.com","swinepro.info"] to get all mails from
"yahoo.com" to "swinepro.info.

Here my problem is that sender and recipient are in two different
docs, with queueid being the common key. Given this data structure is
there any way I can get the data out in the way I want?

Any help will be very much appreciated.

regards,

raj

Mime
View raw message