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

# findOne()

Find the first item that matches the filter

## Example

```java
db.collection("users").findOne({
    _id: "t4m1s8kuw3445ros7zz682no52e9lj91"
}).then(item => {
    console.log(item);
    /*
        item output => {
            _id: "t4m1s8kuw3445ros7zz682no52e9lj91",
            banned: false,
            accountCreated: "13/02/2023",
            example1: "example1",
            example2: "example2",
        };
    */
}).catch(error => {
    console.log("error:", error);
});
```

## findOne(\<filter>)

| Parameter | Description              |
| --------- | ------------------------ |
| filter    | Query for find Operation |
