You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2010/04/03 04:13:25 UTC
[Couchdb Wiki] Trivial Update of "EntityRelationship" by Michael Carrato
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.
The "EntityRelationship" page has been changed by Michael Carrato.
The comment on this change is: Modified map function to use correct 'relation' type comparison.
http://wiki.apache.org/couchdb/EntityRelationship?action=diff&rev1=17&rev2=18
--------------------------------------------------
If you then want to know who is in a group you'll need to use the view (fetch descending to get the group info first)
{{{
"map":function(doc) {
- if (doc.type == 'relationship') {
+ if (doc.type == 'relation') {
emit(doc.group_id,doc.contact_id);
} else if (doc.type == 'group') {
emit(doc._id,doc);