> For the complete documentation index, see [llms.txt](https://lenn.gitbook.io/db-local/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lenn.gitbook.io/db-local/methods/find.md).

# .find()

| Parameter                                                                                                                                                                                                                                                                                                                                                                                                             | Description                                                                                                                                                                                                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number​](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) | In case of a specific search, use the [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) or a [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) with the parameters you are looking for in the document |

| Returns | Description                                                |
| ------- | ---------------------------------------------------------- |
| Object  | The data object that was sought                            |
| Array   | Returns the entire database if an id is not passed in find |

### ​find(\<Query>)

```javascript
// All below works
User.find((obj) => obj._id === 1)
User.find({ _id: 1 })
User.find({ username: "lennart" })
User.find(1)

// {
//   _id: 1, 
//   username: "lennart"
// }
```

If the id is not passed:

```javascript
User.find() // [{ _id: 1, username: "lennart" }]
```
