> For the complete documentation index, see [llms.txt](https://fivesobes.gitbook.io/cherry3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fivesobes.gitbook.io/cherry3/other-operators/update-operators/usdpop.md).

# $pop

| Name                                                  | Usage Type                                    | Description                                                                                                          |
| ----------------------------------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| <mark style="background-color:green;">**$pop**</mark> | <mark style="color:orange;">**Object**</mark> | <mark style="background-color:yellow;">**$pop Operator Uses to Remove Last or First Values ​​in Array Types**</mark> |

```javascript
/* Example Usage */
const model = ...Someone Model

(async () => {

await model.findOneAndUpdate({ name: "Test", age: 20, arr: ["test","test123"] },{ $pop:{ arr:-1 } });
/*
The "arr" value that was ["test","test123"] is now ["test123"]
*/

await model.findOneAndUpdate({ name: "Test", age: 20, arr: ["test","test123"] },{ $pop:{ arr:1 } });
/*
The "arr" value that was ["test","test123"] is now ["test"]
*/

})();

```
