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 9E17A1774B for ; Mon, 9 Mar 2015 13:38:51 +0000 (UTC) Received: (qmail 72226 invoked by uid 500); 9 Mar 2015 13:38:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 72156 invoked by uid 500); 9 Mar 2015 13:38:50 -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 72145 invoked by uid 99); 9 Mar 2015 13:38:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2015 13:38:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kiril@open-net.biz designates 188.138.38.206 as permitted sender) Received: from [188.138.38.206] (HELO open-net.biz) (188.138.38.206) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2015 13:38:44 +0000 Received: from [88.87.6.162] (port=7503 helo=[192.168.69.106]) by teddy.icnhost.net with esmtpsa (UNKNOWN:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1YUxsw-0005Ku-KD for user@couchdb.apache.org; Mon, 09 Mar 2015 14:38:18 +0100 Message-ID: <54FDA211.2030408@open-net.biz> Date: Mon, 09 Mar 2015 15:37:21 +0200 From: Kiril Stankov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: How to get number of normal (non-design) documents in CouchDB? References: <20150301171158.0fac2fe7@mainframe.vimsonnet.se> <71A31F88-1BFA-4046-8967-1F748D3E9557@apache.org> <20150302123034.6df4e534@mainframe.vimsonnet.se> <54FD986A.9040401@open-net.biz> <54FD9979.4060008@open-net.biz> In-Reply-To: Content-Type: multipart/alternative; boundary="------------070706090401050604070609" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - teddy.icnhost.net X-AntiAbuse: Original Domain - couchdb.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - open-net.biz X-Get-Message-Sender-Via: teddy.icnhost.net: authenticated_id: kiril@open-net.biz X-Virus-Checked: Checked by ClamAV on apache.org --------------070706090401050604070609 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks a lot! I like the second one... :) ------------------------------------------------------------------------ *With best regards,* Kiril Stankov, On 09-Mar-15 3:23 PM, Alexander Shorin wrote: > No need to check for doc._id in a view since views doesn't indexed > design documents by default. Just use a single emit(null, null) with > _count to reduce index size. > Another way to to make a two queries: GET /db and GET > /db/_all_docs?startkey="_design"&endkey="_design0" and apply some math > on total documents count and amount of returned design docs. > > > -- > ,,,^..^,,, > > > On Mon, Mar 9, 2015 at 4:00 PM, Kiril Stankov wrote: >> Well, >> >> I think I figured it out. I can create a view and check for doc._id not >> starting with '_design' and then use _count. >> But as I expect to have thousands of documents I'd rather not create a view >> just for counting docs... >> Anyone with better idea? >> >> ------------------------------------------------------------------------ >> *With best regards,* >> Kiril Stankov >> >> On 09-Mar-15 2:56 PM, Kiril Stankov wrote: >>> Hi, >>> anyone aware of a way to get count of non-design documents in CouchDB? >>> Thanks in advance! >>> ------------------------------------------------------------------------ >>> *With best regards,* >>> Kiril Stankov >>> >>> >>> --------------070706090401050604070609--