Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E29E610BCA for ; Wed, 27 Nov 2013 08:38:27 +0000 (UTC) Received: (qmail 30108 invoked by uid 500); 27 Nov 2013 08:38:26 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30079 invoked by uid 500); 27 Nov 2013 08:38:26 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 30071 invoked by uid 99); 27 Nov 2013 08:38:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2013 08:38:26 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bchesneau@gmail.com designates 209.85.192.175 as permitted sender) Received: from [209.85.192.175] (HELO mail-pd0-f175.google.com) (209.85.192.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2013 08:38:21 +0000 Received: by mail-pd0-f175.google.com with SMTP id w10so9417384pde.20 for ; Wed, 27 Nov 2013 00:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=6McC5tK+MRmhJ0LI+Wx7+87GckFMhCkLMf4iwLmyLG0=; b=aMwGyCJf6kk2BgnXR/0y7MF5YmhUdPQoNUX/0hu/8UQMOmcKTZnEd2T2c393CKlqci GBxf39wo+cTPJAxLE7OrycZXZGAPHrBb56ewkHbarcCHVdQK0M148ufgc/ONsowbCiz7 gfSrrhryGUUyN2hVIk99OC2ixBwKLZVItd2GFjuUTU0Xws9gLs6Ha9GiA45D6jOJJfMp n/xApTIVFFfQA+40qZ50EnVMjNy5p1ClnnRF7QZ6zYQ7mpGP3H5gq+SFw4MdbzFXNlBu PDzGVymM3HjXLXyZujRVHYR4SR3p8N568vB79yNqLeCQG6A4N6xq4LRHOhRHtKFc7dFF yMzA== MIME-Version: 1.0 X-Received: by 10.66.149.231 with SMTP id ud7mr40837187pab.8.1385541481518; Wed, 27 Nov 2013 00:38:01 -0800 (PST) Received: by 10.70.59.7 with HTTP; Wed, 27 Nov 2013 00:38:01 -0800 (PST) In-Reply-To: References: Date: Wed, 27 Nov 2013 09:38:01 +0100 Message-ID: Subject: Re: proposed feature - list function /update handler half baby From: Benoit Chesneau To: "user@couchdb.apache.org" Content-Type: multipart/alternative; boundary=047d7b6d95d0d3defe04ec2483ba X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6d95d0d3defe04ec2483ba Content-Type: text/plain; charset=ISO-8859-1 On Wed, Nov 27, 2013 at 9:33 AM, Alexander Shorin 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 > wrote: > > On Wed, Nov 27, 2013 at 4:49 AM, Stanley Iriele >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 > --047d7b6d95d0d3defe04ec2483ba--