incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giovanni P <fiat...@gmail.com>
Subject Humble feature proposal: a little hierarchy solution with `_parent` field and parents passed to mapfun
Date Thu, 12 Jun 2014 13:40:01 GMT
Here's something that would not impose speed or scalability problems for
CouchDB and could create countless possibilities of better organizing and
querying data of various kinds -- mainly docs linked to other docs somehow
--, as well as making views more useful (for storing valuable data not
contained in the document, instead of just indexing it):

1. documents can have a `_parent` field.
2. documents with a `_parent` field will receive its parent document as an
argument to the map functions.
3. every time a document is changed, CouchDB looks for documents that are
children of the changed document and remaps then (there could be an
internal `_children` view for this purpose).
4. when fetching a document or querying a view with `include_docs`, an
optional `include_children` will bring up an array of children at the
`_children` field of the document (when updating the doc, this field should
not be sent back -- clients have to handle this --, and when it is sent, it
is ignored).

What are the problems of this approach? One, I think, would be making
database queries inside handlers. Well, I just realized this could be a
huge problem.

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