> For the complete documentation index, see [llms.txt](https://fivesobes.gitbook.io/nexorm/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/nexorm/operators/update-operators/string-operators/usdslice.md).

# $slice

Update records by extracting a specified portion of an string in a column. The $slice method is used to select a subset of elements from a segment of characters from a string, based on the provided start index and length. This is useful for working with arrays or strings where only part of the data needs to be modified or retrieved.

```typescript
await Member.$update({
    $where: { 
        age: { 
            $eq: 16 
        } 
    },
    $update: {
       $slice: {
         username: { $begin: 1, $end: 5 }
       }
    }
});
```
