---
lang: en
title: 'API docs: repository.crudrepository.count'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.crudrepository.count.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [CrudRepository](./repository.crudrepository.md) &gt; [count](./repository.crudrepository.count.md)

## CrudRepository.count() method

Count matching records

<b>Signature:</b>

```typescript
count(where?: Where<T>, options?: Options): Promise<Count>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  where | <code>Where&lt;T&gt;</code> | Matching criteria |
|  options | <code>Options</code> | Options for the operations |

<b>Returns:</b>

`Promise<Count>`

A promise of number of records matched


