Skip to content

Commit b28be53

Browse files
committed
Emphasize the importance of codec registry order
JAVA-3530
1 parent 806813c commit b28be53

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/reference/content/driver-reactive/getting-started/quick-start-pojo.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ CodecRegistry pojoCodecRegistry = fromRegistries(MongoClientSettings.getDefaultC
151151
fromProviders(PojoCodecProvider.builder().automatic(true).build()));
152152
```
153153

154+
{{% note %}}
155+
156+
The registries are checked in order until one returns a codec for the requested class.
157+
The `DefaultCodecRegistry` should be first in the list, and the `PojoCodecProvider` should always be the last `CodecProvider` since it can provide a codec for almost any class.
158+
159+
{{% /note %}}
160+
154161
### Using the CodecRegistry
155162

156163
There are multiple ways to set the `pojoCodecRegistry` for use:

docs/reference/content/driver/getting-started/quick-start-pojo.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ CodecRegistry pojoCodecRegistry = fromRegistries(MongoClientSettings.getDefaultC
144144
fromProviders(PojoCodecProvider.builder().automatic(true).build()));
145145
```
146146

147+
{{% note %}}
148+
149+
The registries are checked in order until one returns a codec for the requested class.
150+
The `DefaultCodecRegistry` should be first in the list, and the `PojoCodecProvider` should always be the last `CodecProvider` since it can provide a codec for almost any class.
151+
152+
{{% /note %}}
153+
147154
### Using the CodecRegistry
148155

149156
There are multiple ways to set the `pojoCodecRegistry` for use:

0 commit comments

Comments
 (0)