# BaseModel.toJSON() method · @imqueue/pg-sequelize

Source: https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.basemodel.tojson/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-sequelize 4.2.0 — generated reference, not hand-written

Serializes this instance, honouring the `returning` column list.

**Signature:**

```typescript
toJSON(): any;
```
**Returns:**

any

A plain object, ready to send over the wire.

## Remarks

Sequelize's own `toJSON()` emits the loaded attributes. This one also picks up an associated instance, or an array of them, that those attributes do not already cover, and then — if the last write named the columns to return — drops every property that was not named.

