Count
Methods for counting the number of documents.
Count
¶
Methods for counting the number of documents.
Source code in src/scruby/mixins/count.py
count_documents(filter_fn)
async
¶
Asynchronous method.
Count the number of documents a matching the filter in this collection.
Attention
- The search is based on the effect of a quantum loop.
- The search effectiveness depends on the number of processor threads.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter_fn
|
Callable
|
A function that execute the conditions of filtering. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The number of documents. |
Source code in src/scruby/mixins/count.py
estimated_document_count()
async
¶
Asynchronous method.
Get an estimate of the number of documents in this collection using collection metadata.
Returns:
| Type | Description |
|---|---|
int
|
The number of documents. |