Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 93778 invoked from network); 2 Apr 2011 06:46:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2011 06:46:42 -0000 Received: (qmail 97087 invoked by uid 500); 2 Apr 2011 06:46:41 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97060 invoked by uid 500); 2 Apr 2011 06:46:40 -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 97052 invoked by uid 99); 2 Apr 2011 06:46:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Apr 2011 06:46:38 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [145.58.30.184] (HELO out1a.mail.omroep.nl) (145.58.30.184) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Apr 2011 06:46:30 +0000 Received: from localhost (ou1aclean [10.10.30.156]) by out1a.mail.omroep.nl (Postfix MTA - NPO ICT) with ESMTP id 8C3A63C001B6 for ; Sat, 2 Apr 2011 08:46:09 +0200 (CEST) X-Virus-Scanned: NPO ICT Received: from vergiet.vpro.nl (vergiet.vpro.nl [145.58.168.40]) by out1a.mail.omroep.nl (Postfix MTA - NPO ICT) with ESMTP id 6DB103C0009C for ; Sat, 2 Apr 2011 08:46:09 +0200 (CEST) X-ASG-Debug-ID: 1301726762-008352783a6a500001-z14J5S Received: from mail.vpro.nl (mail.vpro.nl [145.58.171.81]) by vergiet.vpro.nl with ESMTP id TPqHO9xRK4my5zUK for ; Sat, 02 Apr 2011 08:46:02 +0200 (CEST) X-Barracuda-Envelope-From: N.Breunese@vpro.nl X-Barracuda-Apparent-Source-IP: 145.58.171.81 Received: from VS-EX-01.intra.vpro.nl ([145.58.171.81]) by VS-EX-01.intra.vpro.nl ([145.58.171.81]) with mapi; Sat, 2 Apr 2011 08:46:01 +0200 From: Nils Breunese To: "user@couchdb.apache.org" Date: Sat, 2 Apr 2011 08:44:24 +0200 Subject: RE: Need to get total rows of startkey/endkey range for paging Thread-Topic: Need to get total rows of startkey/endkey range for paging X-ASG-Orig-Subj: RE: Need to get total rows of startkey/endkey range for paging Thread-Index: Acvw9tgXwZKvpcrUSZiCATh9vgZiVgACo/Kk Message-ID: References: <903CCA92-4022-4ED5-A540-747E4ACCFA58@supercoders.com.au> In-Reply-To: <903CCA92-4022-4ED5-A540-747E4ACCFA58@supercoders.com.au> Accept-Language: nl-NL Content-Language: nl-NL X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: nl-NL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: mail.vpro.nl[145.58.171.81] X-Barracuda-Start-Time: 1301726762 X-Barracuda-URL: http://145.58.168.40:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at vpro.nl X-Barracuda-Bayes: INNOCENT GLOBAL 0.5429 1.0000 0.7500 X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=NORMAL_HTTP_TO_IP X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.59661 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NORMAL_HTTP_TO_IP URI: Uses a dotted-decimal IP address in URL X-Virus-Checked: Checked by ClamAV on apache.org If you set the reduce function of your view to '_count' you will get the nu= mber of items. Query with ?reduce=3Dfalse if you want to get the items inst= ead of just the count. See http://wiki.apache.org/couchdb/Built-In_Reduce_Functions for more info = on built-in reduce functions. Nils. ________________________________________ Van: Andrew Stuart (SuperCoders) [andrew.stuart@supercoders.com.au] Verzonden: zaterdag 2 april 2011 7:27 Aan: user@couchdb.apache.org Onderwerp: Need to get total rows of startkey/endkey range for paging Hey there folks I am issuing a query to a view which uses startkey and endkey to constrain the range of values to be retrieved from the view. Within this I am using skip and limit to page through the results. The problem is that I need the count of the number of total rows, not of the view, but of the range defined by startkey and endkey. This is needed because I am putting the data into a paging grid, and the paging grid needs to know the total rows so it knows how big to make the grid and so it knows where the bottom is. If you are interested here is a sample query: http://192.168.1.108/couchdb/test/_design/blah/_view/by_surname2?startkey= =3D%22s%22&endkey=3D%22s%E9%A6%99%22&_dc=3D1301721696775&page=3D4&skip=3D90= 0&limit=3D300 Views do of course return the total number of items in the view, but I need not the total items in the view but the total items in the startkey/endkey range. Can anyone suggest if this is possible? thanks ------------------------------------------------------------------------ VPRO www.vpro.nl ------------------------------------------------------------------------