You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jaap van der Plas <ja...@brightin.nl> on 2009/05/08 11:20:23 UTC

Deleted documents and revs_info=true

Greetings,

I am working on code to retrieve a deleted document from a database,
and have got as far as to retrieve the revision in which a document
gets deleted. If I pass "revs=true" I do get an array with revision
numbers (not complete ones though for some reason, they lack the
'human-readable' revision number prefix.) However, "rev_info=true"
does not seem to have any effect here. Working as intended? (I am
using the 0.9.0 stable release btw.)

Jaap

Re: Deleted documents and revs_info=true

Posted by Jan Lehnardt <ja...@apache.org>.
On 8 May 2009, at 16:32, Jaap van der Plas wrote:

> The use I am intending for this is providing a change log of sorts
> tell the user which changes were made recently, and in the case of
> document deletion it would be helpful to retrieve the document that
> was deleted to provide info about which document got deleted.

That is a case of relying on CouchDB's revision system to power
the application and you shouldn't do that. If you need to record
an action (change ro deletion of a data item) you want to create
a separate document for that action.


> I have been seeing some messages in the svn log about a _changes api,
> is that made with this sort of use in mind?

the _changes API will replace / augment the db update notification
system. You can query CouchDB with long-polling HTTP requests to
get notified for events in a DB. This might tie in with your use-case.

Cheers
Jan
==


>
> Jaap
>
> On Fri, May 8, 2009 at 15:37, Jan Lehnardt <ja...@apache.org> wrote:
>>
>> On 8 May 2009, at 13:52, Jaap van der Plas wrote:
>>
>>> for that reason (that the revision before deletion may be gone) it
>>> would be helpful to have access to _revs_info, as it specifies which
>>> revisions are still available.
>>
>> No, _rev ids are kept around forever*. Only the content gets removed
>> on compaction. Everything that is not the latest version of a  
>> document
>> must be considered "gone" by the application.
>>
>> * up to the revision stemming threshold.
>>
>> Cheers
>> Jan
>> --
>>
>>
>>>
>>> Jaap
>>>
>>> On Fri, May 8, 2009 at 11:31, Nicholas Orr  
>>> <ni...@zxgen.net> wrote:
>>>>
>>>> Keep in mind that _rev != git like revisions. _rev is for the  
>>>> replication
>>>> and conflict resolution.
>>>> Read more here: http://wiki.apache.org/couchdb/Document_revisions
>>>>
>>>> <http://wiki.apache.org/couchdb/Document_revisions>As for your  
>>>> exact
>>>> issue I
>>>> don't know anything about that. I was pointed in the direction ^  
>>>> above
>>>> and
>>>> thought I'd pass that along as maybe you might not know about it  
>>>> yet
>>>> either
>>>> :)
>>>>
>>>> Nick
>>>>
>>>> On Fri, May 8, 2009 at 7:20 PM, Jaap van der Plas  
>>>> <ja...@brightin.nl>
>>>> wrote:
>>>>
>>>>> Greetings,
>>>>>
>>>>> I am working on code to retrieve a deleted document from a  
>>>>> database,
>>>>> and have got as far as to retrieve the revision in which a  
>>>>> document
>>>>> gets deleted. If I pass "revs=true" I do get an array with  
>>>>> revision
>>>>> numbers (not complete ones though for some reason, they lack the
>>>>> 'human-readable' revision number prefix.) However, "rev_info=true"
>>>>> does not seem to have any effect here. Working as intended? (I am
>>>>> using the 0.9.0 stable release btw.)
>>>>>
>>>>> Jaap
>>>>>
>>>>
>>>
>>
>>
>


Re: Deleted documents and revs_info=true

Posted by Jaap van der Plas <ja...@brightin.nl>.
The use I am intending for this is providing a change log of sorts
tell the user which changes were made recently, and in the case of
document deletion it would be helpful to retrieve the document that
was deleted to provide info about which document got deleted.

I have been seeing some messages in the svn log about a _changes api,
is that made with this sort of use in mind?

Jaap

On Fri, May 8, 2009 at 15:37, Jan Lehnardt <ja...@apache.org> wrote:
>
> On 8 May 2009, at 13:52, Jaap van der Plas wrote:
>
>> for that reason (that the revision before deletion may be gone) it
>> would be helpful to have access to _revs_info, as it specifies which
>> revisions are still available.
>
> No, _rev ids are kept around forever*. Only the content gets removed
> on compaction. Everything that is not the latest version of a document
> must be considered "gone" by the application.
>
> * up to the revision stemming threshold.
>
> Cheers
> Jan
> --
>
>
>>
>> Jaap
>>
>> On Fri, May 8, 2009 at 11:31, Nicholas Orr <ni...@zxgen.net> wrote:
>>>
>>> Keep in mind that _rev != git like revisions. _rev is for the replication
>>> and conflict resolution.
>>> Read more here: http://wiki.apache.org/couchdb/Document_revisions
>>>
>>> <http://wiki.apache.org/couchdb/Document_revisions>As for your exact
>>> issue I
>>> don't know anything about that. I was pointed in the direction ^ above
>>> and
>>> thought I'd pass that along as maybe you might not know about it yet
>>> either
>>> :)
>>>
>>> Nick
>>>
>>> On Fri, May 8, 2009 at 7:20 PM, Jaap van der Plas <ja...@brightin.nl>
>>> wrote:
>>>
>>>> Greetings,
>>>>
>>>> I am working on code to retrieve a deleted document from a database,
>>>> and have got as far as to retrieve the revision in which a document
>>>> gets deleted. If I pass "revs=true" I do get an array with revision
>>>> numbers (not complete ones though for some reason, they lack the
>>>> 'human-readable' revision number prefix.) However, "rev_info=true"
>>>> does not seem to have any effect here. Working as intended? (I am
>>>> using the 0.9.0 stable release btw.)
>>>>
>>>> Jaap
>>>>
>>>
>>
>
>

Re: Deleted documents and revs_info=true

Posted by Jan Lehnardt <ja...@apache.org>.
On 8 May 2009, at 13:52, Jaap van der Plas wrote:

> for that reason (that the revision before deletion may be gone) it
> would be helpful to have access to _revs_info, as it specifies which
> revisions are still available.

No, _rev ids are kept around forever*. Only the content gets removed
on compaction. Everything that is not the latest version of a document
must be considered "gone" by the application.

* up to the revision stemming threshold.

Cheers
Jan
--


>
> Jaap
>
> On Fri, May 8, 2009 at 11:31, Nicholas Orr <ni...@zxgen.net>  
> wrote:
>> Keep in mind that _rev != git like revisions. _rev is for the  
>> replication
>> and conflict resolution.
>> Read more here: http://wiki.apache.org/couchdb/Document_revisions
>>
>> <http://wiki.apache.org/couchdb/Document_revisions>As for your  
>> exact issue I
>> don't know anything about that. I was pointed in the direction ^  
>> above and
>> thought I'd pass that along as maybe you might not know about it  
>> yet either
>> :)
>>
>> Nick
>>
>> On Fri, May 8, 2009 at 7:20 PM, Jaap van der Plas  
>> <ja...@brightin.nl> wrote:
>>
>>> Greetings,
>>>
>>> I am working on code to retrieve a deleted document from a database,
>>> and have got as far as to retrieve the revision in which a document
>>> gets deleted. If I pass "revs=true" I do get an array with revision
>>> numbers (not complete ones though for some reason, they lack the
>>> 'human-readable' revision number prefix.) However, "rev_info=true"
>>> does not seem to have any effect here. Working as intended? (I am
>>> using the 0.9.0 stable release btw.)
>>>
>>> Jaap
>>>
>>
>


Re: Deleted documents and revs_info=true

Posted by Jaap van der Plas <ja...@brightin.nl>.
for that reason (that the revision before deletion may be gone) it
would be helpful to have access to _revs_info, as it specifies which
revisions are still available.

Jaap

On Fri, May 8, 2009 at 11:31, Nicholas Orr <ni...@zxgen.net> wrote:
> Keep in mind that _rev != git like revisions. _rev is for the replication
> and conflict resolution.
> Read more here: http://wiki.apache.org/couchdb/Document_revisions
>
> <http://wiki.apache.org/couchdb/Document_revisions>As for your exact issue I
> don't know anything about that. I was pointed in the direction ^ above and
> thought I'd pass that along as maybe you might not know about it yet either
> :)
>
> Nick
>
> On Fri, May 8, 2009 at 7:20 PM, Jaap van der Plas <ja...@brightin.nl> wrote:
>
>> Greetings,
>>
>> I am working on code to retrieve a deleted document from a database,
>> and have got as far as to retrieve the revision in which a document
>> gets deleted. If I pass "revs=true" I do get an array with revision
>> numbers (not complete ones though for some reason, they lack the
>> 'human-readable' revision number prefix.) However, "rev_info=true"
>> does not seem to have any effect here. Working as intended? (I am
>> using the 0.9.0 stable release btw.)
>>
>> Jaap
>>
>

Re: Deleted documents and revs_info=true

Posted by Nicholas Orr <ni...@zxgen.net>.
Keep in mind that _rev != git like revisions. _rev is for the replication
and conflict resolution.
Read more here: http://wiki.apache.org/couchdb/Document_revisions

<http://wiki.apache.org/couchdb/Document_revisions>As for your exact issue I
don't know anything about that. I was pointed in the direction ^ above and
thought I'd pass that along as maybe you might not know about it yet either
:)

Nick

On Fri, May 8, 2009 at 7:20 PM, Jaap van der Plas <ja...@brightin.nl> wrote:

> Greetings,
>
> I am working on code to retrieve a deleted document from a database,
> and have got as far as to retrieve the revision in which a document
> gets deleted. If I pass "revs=true" I do get an array with revision
> numbers (not complete ones though for some reason, they lack the
> 'human-readable' revision number prefix.) However, "rev_info=true"
> does not seem to have any effect here. Working as intended? (I am
> using the 0.9.0 stable release btw.)
>
> Jaap
>