incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: proposed feature - list function /update handler half baby
Date Wed, 27 Nov 2013 08:38:01 GMT
On Wed, Nov 27, 2013 at 9:33 AM, Alexander Shorin <kxepal@gmail.com> wrote:

> mmm..this would require to be database admin and might not been
> optimal. May be have just update function name there? Also, I believe,
> such call will ignore any custom response from update function, right?
> --
> ,,,^..^,,,
>
>
The purpose would be to only handle the updates of a docs coming in a blik
update. The return message won't change,

For the admin rights, I don't see, all the rights working for a bulk update
will be applied there.

Note that such function could introduce the possibility to have
transactions. Imagine you could also access to the database api in such
function...



> On Wed, Nov 27, 2013 at 12:25 PM, Benoit Chesneau <bchesneau@gmail.com>
> wrote:
> > On Wed, Nov 27, 2013 at 4:49 AM, Stanley Iriele <siriele2x3@gmail.com
> >wrote:
> >
> >> Bulk updates in couchdb are a tad painful. you have to fetch them out of
> >> the database apply your change and save them.
> >>
> >> I propose adding the ability to have something like an update handler
> that
> >> folds across documents
> >>
> >> either in the way that lists do via get row
> >>
> >> ex.
> >>
> >> function (head, req){
> >>
> >> while (var row = getRow()){
> >>     row.doc.name = req.query.name;
> >>     send(row.doc)// except this commits the doc to disk or something
> here
> >> }
> >>
> >> or something along this line...it could return an array over the wire
> like
> >> bulk updates does....on a scale of 1 to 10 how bad of an idea is this?
> >>
> >
> >
> >
> > mmm I was rather thinking to have something like :
> >
> >
> > POST /db/_bulk_update?arg1=..&...
> >
> > {
> >   "docs" = [ doc1, ... docN ],
> >   "update_function": "function(doc, req) {
> >       ...
> >       return edited_doc;
> >   }
> > }
> >
> >
> > Would it works for you?
> >
> > - benoit
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message