---
title: .count()
slug: count
docTags: 
createdAt: 2021-09-14T18:35:54.000Z
---

Returns the number of items in a [Sequence](docId\:JG4itlQWafzLpArttFo67) or [List](docId\:xWH_cUkHj9waqaEfb7H71).

### Syntax

`.count()`

- Returns the total number of items in the Sequence or List

`.count{expression}`

- Returns the number of items in the Sequence or List where the `expression `evaluates to a truthy value

### Examples

- `[1, 2, 3].count()` returns `3`
- `[1, 2, 3].count{it >= 2}` returns `2`
- `db.job.find{dept:engineering}.count()` returns the number of jobs in the Engineering department.
- `db.job.find{dept:engineering}.count{baseComp > 100000}` returns the number of jobs in the Engineering department where base compensation is at least $100k.

