@@ -131,6 +131,12 @@ You can use the following annotations on record components:
131
131
- Specifies a BSON type to store when different from the record component
132
132
type. Accepts the BSON type as the parameter.
133
133
134
+ .. note::
135
+
136
+ The driver supports annotations for Java records, but only if you include them
137
+ when you define the component as shown in the following example record. You
138
+ cannot use the annotations inside the record constructor.
139
+
134
140
Example Annotated Record
135
141
~~~~~~~~~~~~~~~~~~~~~~~~
136
142
@@ -225,4 +231,20 @@ execute a find operation on a collection of ``RecordTree`` types:
225
231
.. output::
226
232
:language: sh
227
233
228
- RecordTree[content=Ranginui, left=RecordTree[content=..., left=RecordTree[content=..., right=RecordTree[content=Ikatere...]]
234
+ RecordTree[content=Ranginui, left=RecordTree[content=..., left=RecordTree[content=..., right=RecordTree[content=Ikatere...]]
235
+
236
+ .. _fundamentals-records-get-codec:
237
+
238
+ Retrieve the Record Codec
239
+ -------------------------
240
+
241
+ You can use the ``RecordCodecProvider`` to retrieve the
242
+ record codec. You should use this interface when you want to customize the codec to encode
243
+ and decode Java record objects to and from corresponding BSON types while
244
+ minimizing duplicate code. To learn more about codecs and their usage,
245
+ see :ref:`Codecs <fundamentals-codecs>`.
246
+
247
+ You can't create a record codec directly, but you can use the
248
+ ``RecordCodecProvider`` to implement the record codec in your code. Learn more
249
+ about the ``RecordCodecProvider``, see the
250
+ `API documentation <{+api+}/apidocs/bson-record-codec/org/bson/codecs/record/RecordCodecProvider.html>`__.
0 commit comments