> self.db.view('<view_id>', keys=['m...@mydomain.com']).
Code looks fine, however I don't expect that you have doc.type with
same value. Keys parameter retrieves all view records that has same
value in key field(first emit value). If you need to view by email
addresses, you have to emit those values as key to build index on
them.
e.g.
function(doc){
if(doc.from==sender){ // probably it have to be `doc.type == 'sender'` ?
emit(doc.from, {'to': doc.to, 'from': doc.from});
emit(doc.to, {'to': doc.to, 'from': doc.from});
}
}
so with this function you may access view by email address key to get
all records about sender/receiver. If you need to split these values,
so you have to emit some additional parameter in key (as ['from,
doc.from]) or group keys with reduce function.
Hope that I've understood your problem right, sorry if not and correct
me then(: Probably, example of document that should be yielded right
could make clear some details.
--
,,,^..^,,,
> --
> You received this message because you are subscribed to the Google Groups "CouchDB-Python" group.
> To post to this group, send email to couchdb...@googlegroups.com.
> To unsubscribe from this group, send email to couchdb-pytho...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/couchdb-python?hl=en.
>
That's not how map functions work; the results of map are precomputed
and cached. There's no way to change their behavior at query time.
Note that this is a property of couchdb, not couchdb-python. Check
out:
http://wiki.apache.org/couchdb/HTTP_view_API
Cheers,
Eli