You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jean-Pierre Fiset <jp...@fiset.ca> on 2010/12/20 17:00:14 UTC

Foreign keys in validate_doc_update?

Is there a way of accessing documents in a database while validating a document update
(validate_doc_update)?

In particular, if a new document inserted to CouchDb contained a field with the id of another
document, would it be possible to retrieve the latter document to verify that the identifier is
valid? Also, is it possible to access the content of that document and use the information found
there during validation?

Thanks,

JP

Re: Foreign keys in validate_doc_update?

Posted by Paul Davis <pa...@gmail.com>.
On Mon, Dec 20, 2010 at 11:00 AM, Jean-Pierre Fiset <jp...@fiset.ca> wrote:
> Is there a way of accessing documents in a database while validating a document update
> (validate_doc_update)?
>

No.

> In particular, if a new document inserted to CouchDb contained a field with the id of another
> document, would it be possible to retrieve the latter document to verify that the identifier is
> valid? Also, is it possible to access the content of that document and use the information found
> there during validation?
>

No.

> Thanks,
>
> JP
>

Allowing the touching of other documents would require making
assertions about referential integrity that could be easily broken
during replication.

HTH,
Paul Davis