> 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/updateone.md).

# updateOne()

Update a single item in a collection

## Example

```javascript
db.collection("users").updateOne({banned: false, xp: "99999"}, {
    "$set": {
        xp: "0"
    }
}).then(() => {
    //Item have been updated;
}).catch(error => {
    console.log("error:", error);
});
```

## updateOne(\<filter>, \<options>)

| Parameter | Description                                  |
| --------- | -------------------------------------------- |
| filter    | The filter used to select the item to update |
