> 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/v2.11.0/types-and-interfaces/modifiable.md).

# Modifiable\<T>

Represents the type for a modifiable entry from a Collection

This type was introduced in version 2.11.0.\
By using this type in [type assertions](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions), it ensures that your code has the correct typings, allowing you to modify an entry's data directly and then to use the new [`Data`](/v2.11.0/types-and-interfaces/data.md)`#save` method.

#### TypeScript declaration:

```typescript
type Modifiable<T> = T & {
  save(): void;
}
```

#### Example TypeScript usage:

```typescript
import { Database, Modifiable } from 'simpl.db';
const db = new Database();

type User = {
  name: string
  age: number
}

const Users = db.createCollection<User>('users');

Users.create({ name: 'Peter', age: 19 });

const user = <Modifiable<User>> Users.get(target => target.name === 'Peter');

user.age = 20;
user.save(); // If you don't use type assertion like above, this will error
```
