couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "itlists@schrievkrom.de" <itli...@schrievkrom.de>
Subject Re: Deletion of a document with GUI not possible ...
Date Thu, 19 Sep 2013 05:02:18 GMT
Yes, I think you are right. I think its a misworkig validate function.

When I look at http://guide.couchdb.org/draft/validation.html there is a 
utility function I used in my validate functions:

function require(field, message) {
     message = message || "Document must have a " + field;
     if (!newDoc[field]) throw({forbidden : message});
   };


and I had a boolean field in my document I tested with this function and it throws an
exception whenever the attribute is false :-)))) I changed this function and now the
errors are gone.

On the other side the GUI of CouchDB never showed me the cause of the deletion error - actually
the
deletion dialog always stayed open.

Marten



Am 18.09.2013 19:11, schrieb Dave Cottlehuber:
> My guess is that you aren't (yet) aware that validation functions also
> apply to document deletions, & one of your validation functions is not
> accepting the updated deleted document. With a single _deleted field
> added, the validation function presumably still passes.
>
> A+
> Dave
>
>

Mime
View raw message