Delete document with empty id

I have a CouchDB database. One of the documents has been edited (in Futon by another developer).
And he lost his ID (don't ask me how he did it).

So, now the document id is an empty string, which makes it impossible to edit or delete through Futon.
Is there a way I could hack into CouchDB to delete this document?

+4
source share
4 answers

I could not delete the document. But the database itself can be deleted.
And I could not reproduce the error in the locale. Another developer says that he simply deleted the _id parameter and saved. I do not know what happened in CouchDB when he did it. But when I do this, it only recreates a new document (as expected).

So, I use couch_docs to get data locally.
Since id is empty, couch_docs does not import it. Therefore, you do not even need to delete it manually.

Then I reimport all the records in another database. I am changing the database name references in my configuration and everything is working fine.
Destroying the database is not a problem, although there is an empty identifier.

+1
source

Technically, the document identifier is immutable, so it is not possible to actually change the _id field. Perhaps another document was created as a copy of the first?

A bug in CouchDB 1.1.0 allowed update functions to create empty string identifiers.

A similar question asks about this, and I missed the passage of deleting empty identifiers .

+1
source

I have not tried, but LoveSeat should be able to open and edit couchedb files ...

0
source

This can be caused (and fixed!) With some error checking. CouchDB is missing for _update handlers, as described in How to delete a couchdb document with an empty "" document id?

0
source

Source: https://habr.com/ru/post/1307117/


All Articles