You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ben Damman <be...@gmail.com> on 2010/09/02 21:33:26 UTC
Using _update function on a design document
Hi everyone.
Exactly how "special" are design documents and what can and can't one do
with them? And why are certain restrictions placed on them?
I am trying to write an update function that will make changes to design
documents. This doesn't seem to work in v1.0.1 but I think it would be a
useful feature. Or maybe I am doing something wrong.
This request:
PUT /db/_design/evil/_update/test/_design%2Fdoc1?field=shows
raises:
new TypeError("doc has no properties", "")
I would love to be able to do clever things with them in views, lists,
shows, updates, update validations, etc. And are design doc conflicts
handled identically to regular doc conflicts?
Being able to dynamically manipulate design docs would give couchapps
magical reflection capabilities. Thoughts? Concerns?
Ben Damman
Google Twin Ports core team member
www.googletwinports.com
Re: Using _update function on a design document
Posted by Ben Damman <be...@gmail.com>.
On Thu, Sep 2, 2010 at 2:41 PM, J Chris Anderson <jc...@apache.org> wrote:
>
> does the same call work against a regular doc?
Yep, it works on regular docs.
Ben
Re: Using _update function on a design document
Posted by J Chris Anderson <jc...@apache.org>.
On Sep 2, 2010, at 12:33 PM, Ben Damman wrote:
> Hi everyone.
>
> Exactly how "special" are design documents and what can and can't one do
> with them? And why are certain restrictions placed on them?
>
> I am trying to write an update function that will make changes to design
> documents. This doesn't seem to work in v1.0.1 but I think it would be a
> useful feature. Or maybe I am doing something wrong.
>
> This request:
>
> PUT /db/_design/evil/_update/test/_design%2Fdoc1?field=shows
>
> raises:
>
> new TypeError("doc has no properties", "")
>
does the same call work against a regular doc?
> I would love to be able to do clever things with them in views, lists,
> shows, updates, update validations, etc. And are design doc conflicts
> handled identically to regular doc conflicts?
>
> Being able to dynamically manipulate design docs would give couchapps
> magical reflection capabilities. Thoughts? Concerns?
>
> Ben Damman
> Google Twin Ports core team member
> www.googletwinports.com