> 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/number-operators/usdrandom.md).

# $random

Update records by setting the value of a numeric or string column to a randomly generated value. The $random method is used to assign a random number or string to a column, which can be useful for generating random data, testing, or introducing variability in records. For numeric columns, it typically generates a random number within a specified range, and for string columns, it may generate random strings or characters.

```typescript
await Member.$update({
    $where: { 
        age: { 
            $eq: 16 
        } 
    },
    $update: {
        $random: {
          age: 1
        }
    }
});
```
