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 12B59658D for ; Wed, 6 Jul 2011 23:47:23 +0000 (UTC) Received: (qmail 71091 invoked by uid 500); 6 Jul 2011 23:47:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 71059 invoked by uid 500); 6 Jul 2011 23:47:20 -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 71051 invoked by uid 99); 6 Jul 2011 23:47:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 23:47:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of maxosmail@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 23:47:16 +0000 Received: by vxd7 with SMTP id 7so512381vxd.11 for ; Wed, 06 Jul 2011 16:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=FSBtx/L6SbgDQmIZKhahfBn9yyU+kmUCWDLqQZLb7vk=; b=p3ACRj20HdXqWxGj716rU0Vs3G2JwpBrWpxq7QvyMrGB7CK9ZoEfRKAnpPsBKC6EKc kSsTAzn4EqAy+ZCrWrarrRHVPpdPxG/AUMP+jx/6QTbTn45w8wqqWr/6Ws1d8Ft/SOZL s8IfbBhkVwdeY13u9M0R4/eEYglj7xiEFIX/8= Received: by 10.52.98.42 with SMTP id ef10mr197464vdb.271.1309996015221; Wed, 06 Jul 2011 16:46:55 -0700 (PDT) MIME-Version: 1.0 Sender: maxosmail@gmail.com Received: by 10.52.114.170 with HTTP; Wed, 6 Jul 2011 16:46:35 -0700 (PDT) In-Reply-To: References: From: Max Ogden Date: Wed, 6 Jul 2011 16:46:35 -0700 X-Google-Sender-Auth: 6jWYmK8UwGGFtglFyhOAGB4w8Sk Message-ID: Subject: Re: Iterating all documents To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf307f380824fa7104a76f377f --20cf307f380824fa7104a76f377f Content-Type: text/plain; charset=UTF-8 Also for bulk editing docs check out (doesn't do them in batch though) http://github.com/maxogden/removalist On Wed, Jul 6, 2011 at 4:45 PM, Randall Leeds wrote: > On Wed, Jul 6, 2011 at 16:41, Matthias Eck > wrote: > > Hello, > > > > I need to add a new field to all documents in my database. > > > > To have a better control I wanted to do this by batches and defined 2 > views: > > documents_without_newfield > > documents_with_newfield > > > > My idea was to just take the first 100 returned by the > > documents_without_newfield view, calculate the new field for all of > > them, save them and take the next 100 etc. > > > > As it turns out the views do not seem to be updated immediately, which > > means that the view documents_without_newfield returns about 95 > > documents that actually already had the new field calculated in the > > previous step. > > If you do not include "stale=ok" with your query, you should get > up-to-date views. > Though, perhaps view groups only update to the latest stable commit on > the database. > In that case, you should be able to get what you want by POSTing to > /_ensure_full_commit or setting the X-Couch-Full-Commit: true header > on your request to update the documents. > --20cf307f380824fa7104a76f377f--