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 <[email protected]> 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
>>
>>
>>
>

Reply via email to