couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiril Stankov <ki...@open-net.biz>
Subject Re: How to get number of normal (non-design) documents in CouchDB?
Date Mon, 09 Mar 2015 13:37:21 GMT
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 <kiril@open-net.biz> 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
>>>
>>>
>>>


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