[GODRIVER-3063] Generate new ObjectID only when required Created: 04/Dec/23  Updated: 12/Dec/23  Resolved: 12/Dec/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.0, 1.14.0

Type: Improvement Priority: Unknown
Reporter: Qingyang Hu Assignee: Qingyang Hu
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Context

External PR: https://github.com/mongodb/mongo-go-driver/pull/1479

any insert operation preemptively generates new ObjectID to check/ensure if _id exists in doc or not - but chances are that goes to waste. this waste is more pronounced in scenarios where _id is a mix of custom userland id and system generated one across collections of a db or even across documents of same collection

Definition of done

What must be done to consider the task complete?

Pitfalls

What should the implementer watch out for? What are the risks?


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