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

# .pull()

Removes all elements with the same value as the provided value from an array based on the provided key.

### pull(key, value)

| **Parameter** | **Description**                                                                                                                                       |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| key           | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></p><p>The key of the target array</p> |
| value         | <p><a href="https://simpldb.gitbook.io/docs/types-and-interfaces/jsondata">JSONData</a></p><p>The value to remove from the array </p>                 |

| **Returns**                                                               | **Description**                               |
| ------------------------------------------------------------------------- | --------------------------------------------- |
| [JSONData](https://simpldb.gitbook.io/docs/types-and-interfaces/jsondata) | The updated data from the provided key's root |

####

```javascript
db.get('numbers'); // [1, 2, 3, 2, 4, 3, 1, 1]

db.pull('numbers', 1); // [2, 3, 2, 4, 3]
```

Also allows the use of dot notation:

```javascript
db.get('user'); // { id: 32171, items: ['sword', 'axe'] }

db.pull('user.items', 'bow'); // { id: 32171, items: ['sword', 'axe'] }
db.pull('user.items', 'sword'); // { id: 32171, items: ['axe'] }
```
