# $dbCount

`$dbCount` counts without loading the documents.

## Syntax

```
$dbCount[collection;(field);(operator);(value)]
```

## Parameters

| Parameter | Description |
|---|---|
| `collection` | Collection name: lowercase letters, digits, `_`, `.` or `-` (up to 64 characters). It is created on first write. |
| `field` | Optional. Field to test. |
| `operator` | Optional. `=` (default), `!=`, `<`, `<=`, `>`, `>=` or `prefix`. |
| `value` | Value to compare, read like in [`$dbFind`](/docs/dbfind/). |

## Return value

- The number of documents.

## Examples

```bdfd
$dbCount[players]
$dbCount[players;xp;>=;100]
```
