[JAVA-4426] Add support for BsonExtraElements when encoding/decoding POJOs Created: 11/Dec/21  Updated: 28/Oct/23  Resolved: 21/Apr/22

Status: Closed
Project: Java Driver
Component/s: POJO
Affects Version/s: None
Fix Version/s: 4.7.0

Type: New Feature Priority: Major - P3
Reporter: Adam Harrison Assignee: Ross Lawley
Resolution: Fixed Votes: 1
Labels: QP-priority, size-small
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Quarter: FY23Q1
Case:
Documentation Changes: Needed

 Description   

The Java driver should support BsonExtraElements annotation on POJOs. This flag would provide the ability to leave any extra document elements untouched when performing encoding and decoding.

This feature can be helpful in when performing schema migrations, as it may reduce the need update applications to handle different versions of schemas.

This flag already exists in other drivers such as C#: https://mongodb.github.io/mongo-csharp-driver/2.14/apidocs/html/T_MongoDB_Bson_Serialization_Attributes_BsonExtraElementsAttribute.htm



 Comments   
Comment by Jeffrey Yemin [ 21/Apr/22 ]

Unfortunately it just missed the 4.6.0 release train, so it will be coming in 4.7.0, in the June timeframe.

Comment by Hemambara Kotari [ 21/Apr/22 ]

Thanks for fixing it. can you let us know the maven version that we need to use to utilize this. THanks

Comment by Githook User [ 21/Apr/22 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: PojoCodec added BsonExtraElements annotation

JAVA-4426
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/95cb47a61f2896044e69ab73d59306e1527686e2

Comment by Hemambara Kotari [ 02/Feb/22 ]

Hi, Is there any way that his can be provided in Q2 of this year ? Like around June, 2022. We are working on a critical project and this is very much needed and a blocker for us. 

Comment by Hemambara Kotari [ 25/Jan/22 ]

Hi, May I know what is the plan to release mongo java driver 4.6.0? Any ETA?

Generated at Thu Feb 08 09:02:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.