couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yves S. Garret" <yoursurrogate...@gmail.com>
Subject Re: Trying to wrap my head around CouchDB
Date Tue, 16 Jul 2013 22:38:24 GMT
On Tue, Jul 16, 2013 at 6:35 PM, Yves S. Garret
<yoursurrogategod@gmail.com>wrote:

> On Tue, Jul 16, 2013 at 6:06 PM, Oliver Schmidt <spiollinux@googlemail.com
> > wrote:
>
>>
>> > Ok.  Say in MySQL I have an orders table, a customers table and an
>> items
>> > table (where the stuff that I want to sell is located).  How would this
>> > look like
>> > in CouchDB?
>> You put each customer, order and item into its own document.
>>
>> > So you would have each customer, order and items document, but how
>> would
>> > you differentiate between the 3 types of documents?
>> A common way to do that is to give each document a "type" attribute and
>> then check for certain types in the views.
>> The guide is quite outdated, nevertheless the first chapters are very
>> informative, good to read and still correct.
>>
>> > I realize that this is not the same as MySQL, but I'm trying to find the
>> > relationships
>> > (and model them in my head) as to how I could do the same thing in
>> CouchDB.
>> Maybe you need some time to "unlearn" these SQL things. I find CouchDBs
>> way of handling documents intuitive, maybe because I never really learned
>> SQL ;)
>>
>
> It seems that way :) .  The very first OS that I used was MySQL, it was
> open source and
> relatively easy to setup, so I gave it a shot.
>

Now, if I wanted to reference one document to another, I imagine I would
create a separate
field that would contain the _id of the other document (in case I wanted to
establish a
relationship between the two).  Would that make sense or is there another
approach that I
should consider?

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