You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Stanley Iriele <si...@gmail.com> on 2013/10/15 22:56:03 UTC

Pulling more docs into update handler

How bad of an idea would it be to add some parameter like include_doc to
the update_handler that takes a doc Id..and that doc I'd gets included in
the parameters.

So the the method signature would be.

function ( doc, req, included)

Where included is either one doc or an array or docs....( depending on how
it gets implemented).

I just think it would be invaluable to have such power in an update
handler.. But honestly one doc would be enough for me

Re: Pulling more docs into update handler

Posted by Mark Hahn <ma...@reevuit.com>.
Why stop at two?


On Tue, Oct 15, 2013 at 7:34 PM, Stanley Iriele <si...@gmail.com>wrote:

> I think I understand that...but from my standpoint (which could be totally
> wrong) and update handler draws the latest doc from the db when it can
> anyway..do if the second doc is not there that'd is totally fine...having
> the ability to pull up 2 docs saves a view/list call with and a round trip.
>
> Ultimately what gets committed to disk is the first entry in the array that
> gets returned whatever it is.
>
> But I do see your point I just thought it would be neat.... I may write a
> plugin to do this because it seems pretty snazzy
> That would violate our fundamental approach that a document stands alone
> (that we make no promises about *other* documents contents or even
> presence).
>
> B.
>
> On 15 Oct 2013, at 21:56, Stanley Iriele <si...@gmail.com> wrote:
>
> > How bad of an idea would it be to add some parameter like include_doc to
> > the update_handler that takes a doc Id..and that doc I'd gets included in
> > the parameters.
> >
> > So the the method signature would be.
> >
> > function ( doc, req, included)
> >
> > Where included is either one doc or an array or docs....( depending on
> how
> > it gets implemented).
> >
> > I just think it would be invaluable to have such power in an update
> > handler.. But honestly one doc would be enough for me
>

Re: Pulling more docs into update handler

Posted by Stanley Iriele <si...@gmail.com>.
I think I understand that...but from my standpoint (which could be totally
wrong) and update handler draws the latest doc from the db when it can
anyway..do if the second doc is not there that'd is totally fine...having
the ability to pull up 2 docs saves a view/list call with and a round trip.

Ultimately what gets committed to disk is the first entry in the array that
gets returned whatever it is.

But I do see your point I just thought it would be neat.... I may write a
plugin to do this because it seems pretty snazzy
That would violate our fundamental approach that a document stands alone
(that we make no promises about *other* documents contents or even
presence).

B.

On 15 Oct 2013, at 21:56, Stanley Iriele <si...@gmail.com> wrote:

> How bad of an idea would it be to add some parameter like include_doc to
> the update_handler that takes a doc Id..and that doc I'd gets included in
> the parameters.
>
> So the the method signature would be.
>
> function ( doc, req, included)
>
> Where included is either one doc or an array or docs....( depending on how
> it gets implemented).
>
> I just think it would be invaluable to have such power in an update
> handler.. But honestly one doc would be enough for me

Re: Pulling more docs into update handler

Posted by Robert Newson <rn...@apache.org>.
That would violate our fundamental approach that a document stands alone (that we make no promises about *other* documents contents or even presence).

B.

On 15 Oct 2013, at 21:56, Stanley Iriele <si...@gmail.com> wrote:

> How bad of an idea would it be to add some parameter like include_doc to
> the update_handler that takes a doc Id..and that doc I'd gets included in
> the parameters.
> 
> So the the method signature would be.
> 
> function ( doc, req, included)
> 
> Where included is either one doc or an array or docs....( depending on how
> it gets implemented).
> 
> I just think it would be invaluable to have such power in an update
> handler.. But honestly one doc would be enough for me