You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by bsquared <bw...@gmail.com> on 2012/05/11 18:32:48 UTC

Re: Couch DB metadata

"dan@danmyersconsulting.com"
<da...@danmyersconsulting.com> writes:

> Can someone tell me or point me to documentation on how to view CouchDB's document metadata; how to add additional 'comments' at the document attribute level?
You may consider a data-dictionary document for the db.  Use it to store
meta-data for each document type.
-- 
Regards,
Brian Winfrey


Re: Couch DB metadata

Posted by Jens Alfke <je...@couchbase.com>.
On May 11, 2012, at 10:52 AM, dan@danmyersconsulting.com<ma...@danmyersconsulting.com> wrote:

Brian, how do I do that in the database itself so other users can see it?

CouchDB is freeform, remember. Just create a document with some pre-defined ID (like “attribute_metadata” perhaps) and store metadata in it in some pre-defined format.

(Or it might be better to store this in a new attribute of a design document, instead of your own document; in that case you’d need to pre-define the name of the design document.)

—Jens

Re: Couch DB metadata

Posted by bsquared <bw...@gmail.com>.
"dan@danmyersconsulting.com"
<da...@danmyersconsulting.com> writes:

> Brian, how do I do that in the database itself so other users can see it?
> -- 
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> bsquared <bw...@gmail.com> wrote:
>
> "dan@danmyersconsulting.com"
> <da...@danmyersconsulting.com> writes:
>
>> Can someone tell me or point me to documentation on how to view CouchDB's document metadata; how to add additional 'comments' at the document attribute level?
> You may consider a data-dictionary document for the db. Use it to store
> meta-data for each document type.

The thought I had is to create a document in the db whose type is defined as
"data-dictionary".  That document contains an array of document
definitions. You could then define views that enumerate the defintions.  

{
  "_id": DATA_DICTIONARY,
  "_rev": "01",
  "doc_type": "data_dictionary",
  "document_definitions": {
    "person_doc": {
      "f_name": "string",
      "m_name": "string",
      "l_name": "string",
      "birth_date": "date",
      ...
    }
  }
}

You may also want to look at kanso. It has an admin module which works
in conjuntion with a couch-types module to generate forms dynamically.
I think it could be used as an example to create a javascript solution.


http://github.com/kanso

-- 
Regards,
Brian Winfrey


Re: Couch DB metadata

Posted by "dan@danmyersconsulting.com" <da...@danmyersconsulting.com>.
Brian, how do I do that in the database itself so other users can see it?
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

bsquared <bw...@gmail.com> wrote:

"dan@danmyersconsulting.com"
<da...@danmyersconsulting.com> writes:

> Can someone tell me or point me to documentation on how to view CouchDB's document metadata; how to add additional 'comments' at the document attribute level?
You may consider a data-dictionary document for the db. Use it to store
meta-data for each document type.
-- 
Regards,
Brian Winfrey