Annotation Interface BsonExtraElements


@Documented @Retention(RUNTIME) @Target({METHOD,FIELD,PARAMETER}) public @interface BsonExtraElements
An annotation that configures a property to be used as storage for any extra BSON elements that are not already mapped to other properties. All extra elements will be encoded from the BSON document into the annotated property, and encoded from the annotated property into the BSON document.

Can only be used on a single field in a POJO. Field must be a Map<String, ?> instance eg. Document or BsonDocument.

For POJOs, requires the Conventions.ANNOTATION_CONVENTION

For Java records, the annotation is not yet supported.

Since:
4.7
See Also: