Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/configuration/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ public class User
}
```

## Polymorphic Serialization <Badge type="warning" text=".NET 9+ & System.Text.Json Only" />

::: tip
This is specifically to do with types stored _within_ documents. For polymorphism at the root document level see [Multi Level Hierarchies](/documents/hierarchies#multi-level-hierarchies)
:::

Due to `jsonb` providing no guarantee on what order it stores properties in, metadata fields that usually sit at the start of a type can be in any position.

When using types annotated with `[JsonDerivedType]`, you **MUST** opt into the ability for the serializer to find metadata fields that are out of order.

```cs
options.AllowOutOfOrderMetadataProperties = true;
```

## Collection Storage <Badge type="warning" text="Newtonsoft Only" />

Marten by default stores the collections as strongly typed (so with $type and $value). Because of that and current `MartenQueryable` limitations, it might result in not properly resolved nested collections queries.
Expand Down
Loading
Loading