> For the complete documentation index, see [llms.txt](https://simpldb.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simpldb.js.org/documentation/collection/has.md).

# .has()

Checks if there is any entry matching the provided filter.

### has(filter)

| **Parameter** | **Description**                                                                                                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| filter        | <p><a href="https://developer.mozilla.org/en-US/docs/Glossary/Callback_function">Callback</a></p><p>Function to test each element of the array. Return a value that coerces to <code>true</code> to keep the element, or to <code>false</code> otherwise</p> |

| **Returns**                                                                                         | **Description**                                                |
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | Whether or not there is any entry matching the provided filter |

```javascript
// Note: Users is a collection.

Users.getAll(); // [{ id: 1, name: '5antos' }]

Users.has(u => u.name === '5antos'); // true
Users.has(u => u.id === 2); // false
```
