You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jim Klo <ji...@sri.com> on 2011/05/21 02:53:33 UTC

Query Local Docs?

Is there a way to query local docs?

Per http://wiki.apache.org/couchdb/Complete_HTTP_API_Reference
Special non-replicating documents

GET
/db/_local/local-doc
Returns the latest revision of the non-replicated document
PUT
/db/_local/local-doc
Inserts a new version of the non-replicated document
DELETE
/db/_local/local-doc
Deletes the non-replicated document
COPY
/db/_local/local-doc
Copies the non-replicated document

But is there a way to do a GET /db/_local? or is there some parameter to add to GET /db to include locals?

Thanks,

- Jim

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International





Re: Query Local Docs?

Posted by Robert Newson <ro...@gmail.com>.
There is no way currently to list all local docs, or use them in
views, etc. The purpose of local documents to date is for replication
checkpoints which doesn't need those features.

B.

On 23 May 2011 08:50, Paul Hirst <pa...@sophos.com> wrote:
> On Sat, 2011-05-21 at 01:53 +0100, Jim Klo wrote:
>> Is there a way to query local docs?
> [snip]
>>
>> But is there a way to do a GET /db/_local? or is there some parameter
>> to add to GET /db to include locals?
>
> I asked this a few weeks ago on IRC and was told there wasn't a way to
> do this. They appear to be totally invisible unless you know what they
> are called.
>
> However if you are trying to fiddle with the replication documents you
> can discover what they are called by looking in the couch log. When
> replication starts it spits out a message like
>
> starting new replication "f3f357dd7528fc1983437707dd97780e"
>
> The MD5 is a product of various attributes of the replication
> source/target like hostname, database name, etc. I don't know the
> precise details.
>
> The replication document ID is, in this case,
> _local/f3f357dd7528fc1983437707dd97780e
>
> So you can get it and update it as usual.
>
> If you aren't looking for replication documents I hope this is useful to
> someone else who is looking for them, as I was a few weeks back.
>
>
> Sophos Limited, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
> Company Reg No 2096520. VAT Reg No GB 991 2418 08.
>

Re: Query Local Docs?

Posted by Paul Hirst <pa...@sophos.com>.
On Sat, 2011-05-21 at 01:53 +0100, Jim Klo wrote:
> Is there a way to query local docs?
[snip]
>
> But is there a way to do a GET /db/_local? or is there some parameter
> to add to GET /db to include locals?

I asked this a few weeks ago on IRC and was told there wasn't a way to
do this. They appear to be totally invisible unless you know what they
are called.

However if you are trying to fiddle with the replication documents you
can discover what they are called by looking in the couch log. When
replication starts it spits out a message like

starting new replication "f3f357dd7528fc1983437707dd97780e"

The MD5 is a product of various attributes of the replication
source/target like hostname, database name, etc. I don't know the
precise details.

The replication document ID is, in this case,
_local/f3f357dd7528fc1983437707dd97780e

So you can get it and update it as usual.

If you aren't looking for replication documents I hope this is useful to
someone else who is looking for them, as I was a few weeks back.


Sophos Limited, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 991 2418 08.