incubator-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 20:13:27 GMT
On Tue, Jul 16, 2013 at 4:11 PM, Tim Black <tim@alwaysreformed.com> wrote:

> Yves,
>
> These pages will help you with these questions:
>
> http://guide.couchdb.org/editions/1/en/views.html
> http://guide.couchdb.org/editions/1/en/lists.html
> http://guide.couchdb.org/editions/1/en/cookbook.html
>
> More specifically,
>
> On 07/16/2013 02:51 PM, Yves S. Garret wrote:
> > 1 - How is data represented in CouchDB as compared to MySQL?
> MySQL lets you define each table's schema in terms of what column names
> and types are found in each table, and what indexes optimize searching
> what columns in each table.
> > How can I
> > create (or visualize in
> > my head) multiple tuples of the same type of data (as in a table that has
> > columns of specific types
> > and then each entry is a row)?  If I need to store multiple orders in a
> > system (where the data looks
> > roughly the same, how would that look?
> In CouchDB, there is no schema, so you have more options for how to
> structure your data, but a common way to mimic MySQL's tables in CouchDB
> is as follows:
>
> Each row of a MySQL table is one JSON document in CouchDB.  Each
> document contains a "type" or "collection" (in backbone-couchdb, for
> instance) attribute, so one example document could be {"type":"order",
> "name":"Honda Accord", "amount":"10,000.00"}.  You could make other
> documents which also contain the attribute "type":"order".  All these
> "order" documents would be roughly equivalent to a table in MySQL named
> "order".
>
> To get all order documents in one request, write, then query, a view
> which only emits documents if (doc.type == 'order').
> > 2 - How is binary data handled inside of CouchDB?
> As attachments to documents.
> >   As in, how is data
> > stored inside of CouchDB
> > and then used (text and binary)?
> Attachments can be directly accessed at a URL under the URL for the
> document to which they are attached.
>
> Tim
>
>
Ok, got it.  So you have a "type" attribute.  That makes sense.

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