incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John <john.logs...@netdev.co.uk>
Subject Linked Documents
Date Mon, 26 Jul 2010 21:38:17 GMT
Hi

I have a Use Case where I store an Account Tree in the database. Each Account Node points
to its parent and I can resolve the tree using several database  queries by getting the account
then its parent then its parents parent, I guess you get the idea!

We store data as attributes in these account objects and inheritance is used to easily propogate
attributes down the account tree and override them at each node as required.

I've just been reading the wiki and seen a nice feature where I can emit index entries with
foreign id's which is great if I already know them in the doc my map function is working on
however I would prefer to just reference my parent and then *follow* that link to get the
parent doc and retrieve it's parent id from there.

So I guess what I'm trying to ask for here is whether I can retrieve another  document from
the database, by id, from within the map function in a view?
I can see lots of other places in our design where this could be really useful especially
for validation of referenced id's within documents.

Thanks

John
Mime
View raw message