couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: include_docs with _all_docs
Date Wed, 09 May 2012 21:53:24 GMT

1. I'm in data management. There is a strong business case for having
robust business descriptions for each column (where it came from, what it
means, who entered it, how it's calculated...etc). Risk officers need to
analyze what data is in a db that (aka after a developer builds the
database and moves on nobody will know what attributes exist--without
reverse engineering the application). Business analysts have no way of
conducting Business Intelligence without knowing what they are querying.
How do you do this without descriptions?

2. Great this is helpful, I'll research more.

3. Trying to accomplish what is discussed in #1, but at the "column"
level. How would I count (or any other business analytic) tweets from
people in US, Japan, Brazil if my docs are tweets by IP, Country, Date?
How do I know that all tweets have "Country" on them if there isn't any
metadata to say so? If the follow-up business question is what the counts
are by country by day, how do I form a query by "Date" if I don't know
that the "column" for date even exists without metadata?

> On May 9, 2012, at 1:21 PM, <>
> <> wrote:
>> 1. If I don't know what attributes exist in the database there is no way
>> to write a query about those attributes on documents.
> Usually you know something about the schema of the data in a database
> before writing code to operate on it. CouchDB doesn’t enforce any schema,
> but you’d generally define what properties you put in documents
> beforehand.
> What kind of program are you writing? I’m not an RDBMS guru but I’ve
> written some apps that use SQL databases, and I haven’t had to introspect
> the metadata of the table columns. I’ve defined my tables and then written
> my queries using the columns I defined.
> Keep in mind that, to some degree, it doesn’t make sense to ask ‘what
> attributes exist in the database’ because every document could have a
> different set of attributes. It’s very unlikely but possible. CouchDB has
> nothing comparable to ‘columns’ in SQL; every document is an independent
> bag of JSON.
>> 2. If I create my own attribute of a document which stores metadata for
>> that document it works but if that metadata attribute isn't a required
>> attribute for all docs then how can I enforce the collection of metadata
>> which supports #1 above?
> You can add a validation function to a design document that will enforce
> the presence of that attribute, or any structure you want your documents
> to have.
>> 3. I can create a attribute that would provide a description of a
>> document, e.g.#2 above (aka metadata) but how do I create an attribute
>> of
>> a document attribute? (e.g. an description for a document attribute
>> called
>> "telephone", which is now an attribute of an attribute or
>> meta-attribute)?
> I really have no idea where you’re going with this. It’s awfully abstract.
> What are you trying to accomplish?
> —Jens

View raw message