couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlad GURDIGA <gurd...@gmail.com>
Subject Re: Defining my document model when the source is entity-relationship
Date Thu, 09 Jul 2009 20:16:25 GMT
On Thu, Jul 9, 2009 at 9:46 PM, Thad Guidry<thadguidry@gmail.com> wrote:
> Morbus,
>
> I can think of one wiki article that helped me tremendously in understanding
> the CouchDB way of relationships.  And how I could apply that to library
> cataloging techniques.
>
> http://wiki.apache.org/couchdb/EntityRelationship

I apologize for the fact that I may be a little off-topic but reading
this article a question came up regarding the second model presented
in the "One to Many: Embedded Documents" section:

{
  "_id":"Scott",
  "type":"contact",
  "name":"My Friend Scott",
  "phones":[{"home":"(650) 555 - 2200"},{"mobile":"(650) 555 - 2201"}],
}

What is the pros and cons of having phones stored as an array of
associative hashes versus having them as an associative hash? Here is
what I mean:

{
  "_id":"Scott",
  "type":"contact",
  "name":"My Friend Scott",
  "phones":{"home":"(650) 555 - 2200","mobile":"(650) 555 - 2201"}
}

It seams to me more intuitive syntax.

Mime
View raw message