You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "itlists@schrievkrom.de" <it...@schrievkrom.de> on 2013/09/18 16:53:50 UTC
Deletion of a document with GUI not possible ...
I have here databases, where I can not delete a document from within the
browser GUI - it simpley fails. Even the API call "delete" fails. Very
often it goes away if I delete ALL design documents.
When I add a field "_deleted" (in the browser) I can delete the
document always ...
Any idea ???
Re: Deletion of a document with GUI not possible ...
Posted by "itlists@schrievkrom.de" <it...@schrievkrom.de>.
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
>
>
Re: Deletion of a document with GUI not possible ...
Posted by Dave Cottlehuber <dc...@jsonified.com>.
A little more information will help us :-)
what "fail" means - specifically try to do curl -vX DELETE
$COUCH/db/document and show us the output.
couchdb version & platform you are running on.
a link to a sample document that doesn't work, & any design documents
that have a validate_update function.
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
On 18 September 2013 16:53, itlists@schrievkrom.de
<it...@schrievkrom.de> wrote:
> I have here databases, where I can not delete a document from within the
> browser GUI - it simpley fails. Even the API call "delete" fails. Very often
> it goes away if I delete ALL design documents.
>
> When I add a field "_deleted" (in the browser) I can delete the document
> always ...
>
> Any idea ???