## protocols.dao.FindResult

<span id="hexkit.protocols.dao.FindResult"></span>


An async-iterable result from find_all() that also exposes pagination metadata.


Usage

``` python
protocols.dao.FindResult(
    *,
    results_iterator,
    get_total_count,
)
```


The [total_count()](protocols.dao.FindResult.md#hexkit.protocols.dao.FindResult.total_count) method performs an additional count query on first call (lazily) and caches the result for subsequent calls.


## Methods

| Name | Description |
|----|----|
| [to_list()](#to_list) | Collect all results into a list. |
| [total_count()](#total_count) | Total number of matching documents, ignoring skip and limit. |

<span id="hexkit.protocols.dao.FindResult.to_list"></span>


#### to_list()


Collect all results into a list.


Usage

``` python
to_list()
```


Calling this function will consume the iterator. Subsequent cals will return an empty list.


<span id="hexkit.protocols.dao.FindResult.total_count"></span>

------------------------------------------------------------------------


#### total_count()


Total number of matching documents, ignoring skip and limit.


Usage

``` python
total_count()
```


The result is cached after the first call.
