couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: inconsistent behavior in _all_docs with deleted documents
Date Tue, 15 Feb 2011 00:22:16 GMT
Paul,

I say it's inconsistent because _all_docs gives 'doc: null' while
_changes gives ' doc: {"_id": ..., "_rev": ..., "_deleted": true} '.

I'm not proposing changing the behaviour in maintenance branches but
wondering what is the reason for this (if any) and maybe change it in
a future release.
Also, as of this revision:

https://github.com/apache/couchdb/commit/32c60cf5c554a1ff3819cc658ebf5846ccb9d6be

Deleted document bodies may have other data besides the _id and _rev
(if for example, you POST to _bulk_docs with documents having '
"_deleted": true ' in their body). This can be either harmless/good
(have extra info) or bad (for security reasons).

I'm a bit indifferent about which alternative to use, only more
concerned with consistency. Gordon's finding led me to notice this
difference between _all_docs and _changes.


On Mon, Feb 14, 2011 at 9:58 PM, Gordon <tsr2600@gmail.com> wrote:
> Paul Davis wrote:
>>
>> _all_docs shouldn't respond with *anything* if the doc is deleted as
>> _all_docs is a representation of what's in the database when the
>> request started.
>
> +1
>
>> On the other hand _changes *should* show the doc (once, for the
>> update_seq where it was deleted).
>
> I think for the _changes response, returning something in the 'doc' member
> is misleading as at the seq that the document was deleted, there was no
> document. The question "what happened to it?" is answered by the information
> already given in that row of the _changes response.
>
> (this is all imho, of course, and I agree that old branches shouldn't
> include any changes we decide to make)
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message