[CDRIVER-2796] Make ObjectId, timestamp, datetime overwritable Created: 15/Aug/18  Updated: 28/Oct/23  Resolved: 07/Sep/18

Status: Closed
Project: C Driver
Component/s: libbson
Affects Version/s: None
Fix Version/s: 1.13.0

Type: Improvement Priority: Minor - P4
Reporter: Kaitlin Mahar Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

In libbson, it is possible to overwrite some of the fixed-length types (bool, int32, int64, double, decimal128) in place on a bson_t using bson_iter_overwrite_[typename]. We utilize this functionality in the Swift driver to avoid creating a new bson_t when one of those types is overwritten with a new value of the same type.

Since ObjectIds are also fixed length, it would be useful if they could similarly be overwritten in-place.



 Comments   
Comment by Githook User [ 07/Sep/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2796 more bson_iter_overwrite functions

Add bson_iter_overwrite_date_time, bson_iter_overwrite_oid, and
bson_iter_overwrite_timestamp.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7f12d67236534b84ca49b61f71fa670eb60c0f94

Comment by Kaitlin Mahar [ 16/Aug/18 ]

oh yes, those are also fixed length. makes sense to me. 

Comment by Kevin Albertson [ 16/Aug/18 ]

Good point, I assume we should also do also this for the timestamp and datetime types?

Generated at Wed Feb 07 21:16:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.