couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pete Hodgson <pub...@thepete.net>
Subject Re: representing many-to-many relations with concurrent inserts
Date Mon, 30 Nov 2009 23:05:27 GMT
Roger, please accept my apologies. I'll be sure to not cross-post on this
list again. Nathan, thanks for the link. That's a very helpful post.

So do I take it from that post that creating a mapping document like I
described below is the Right Way to deal with concurrent update concerns?
Also, is there any way to formulate a view into a many-to-many relationship
which allows include_docs to work correctly? The view I have to retrieve all
log entries matching a log topic currently looks something like:

function(doc) {
      if( doc['couchrest-type'] != 'LogTopicToLogEntryMap' )
        return;

      emit(doc['topic_id'], doc['entry_id']);
    }

This works, but I have to manually pull out the entry_id array in the client
and then use it to do a second view query to get the actual log entries. I
could create a view which contains the log entry document itself, but I'm
concerned about the amount of data duplication this would cause, given that
log entries will be the most common document by far in the system.

Cheers,
Pete

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message