Skip to content

Commit

Permalink
docs: add note about forceObject for implicit serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Dec 23, 2023
1 parent 32ccbcc commit 5132e5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/docs/serializing.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ Primary keys are automatically included. If you want to hide them, you have two
- use `hidden: true` in the property options
- use `serialization: { includePrimaryKeys: false }` in the ORM config

Unpopulated relations are serialized as foreign key values, e.g. `{ author: 1 }`, if you want to enforce objects, e.g. `{ author: { id: 1 } }`, use `serialization: { forceObject: false }` in your ORM config.

**This also works for embeddables, including nesting and object mode.**

## Explicit serialization
Expand Down

0 comments on commit 5132e5e

Please sign in to comment.