Skip to content

Commit

Permalink
Introduce the function for deep merging
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Boberg <[email protected]>
  • Loading branch information
axelboberg committed Feb 29, 2024
1 parent e3aa8ea commit ba6023d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Operation | Example | Description
`$replace` | `{myArr: {$replace: ['new', 'values']}}` | Replace a value without trying to merge this key any deeper, this is useful for replacing complete arrays
`$insert` | `{myArr: {$insert: 'my new value', $index: 2}}` | Insert a value at an index in an array - items will be pushed back and not deleted, this is using a splice operation under the hood
`$push` | `{myArr: {$push: ['foo', 'bar']}}` | Merge an array with an already existing array by pushing all new values to the current array's tail
`$invert` | `{myBoolean: {$invert: true}}` | Inverts the current value at the key as if it was a boolean such that the new value is `!oldValue`

**Example usage**
```javascript
Expand Down

0 comments on commit ba6023d

Please sign in to comment.