[JAVA-2583] Add BsonWriter implementation that appends extra BSON elements to the top-level document Created: 14/Aug/17  Updated: 29/Oct/23  Resolved: 14/Aug/17

Status: Closed
Project: Java Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 3.6.0

Type: New Feature Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change

 Description   

The OP_MSG specification requires that global arguments like $db and $readPreference are appended to the command document. So as not to require the core driver to modify command documents that it doesn't own, or clone those documents into a new BsonDocument, create a new BsonWriter implementation that can append a list of BSON elements to the end of the top-level document. This BsonWriter will be used by the OP_MSG serializer to efficiently encode the command document to the wire.



 Comments   
Comment by Githook User [ 14/Aug/17 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: JAVA-2583: Add ElementExtendingBsonWriter to enable efficient appending of extra BSON element to the end of a document as it's being encoded.
This avoids having to potentially hydrate a RawBsonDocument or BsonDocumentWrapper into a full BsonDocument when using the OP_MSG wire protocol.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/f98cc3e6d1cdf4f17cb97df721ee904f5fa986a2

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