Skip to content

Conversation

qingyang-hu
Copy link
Collaborator

GODRIVER-3326

Summary

  • Add ObjectIDAsHexString to BSONOptions and enable it to set the bson.Decoder.
  • Set up TestGetDecoder and TestGetEncoder to guarantee:
    • Each bson.Decoder/bson.Encoder config method has a corresponding field in BSONOptions.
    • getDecoder()/getEncoder() calls the corresponding bson.Decoder/bson.Encoder config methods according to BSONOptions fields.
  • Remove the never-used error return from EncoderFn.

Background & Motivation

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the review-priority-low Low Priority PR for Review: within 3 business days label Sep 4, 2024
Copy link
Contributor

API Change Report

./v2/mongo/options

compatible changes

BSONOptions.ObjectIDAsHexString: added

./v2/x/mongo/driver

incompatible changes

##CursorOptions.MarshalValueEncoderFn: changed from func(io.Writer) (*./v2/bson.Encoder, error) to func(io.Writer) *./v2/bson.Encoder

@qingyang-hu qingyang-hu marked this pull request as ready for review September 4, 2024 22:35
@qingyang-hu qingyang-hu added review-priority-normal Medium Priority PR for Review: within 1 business day and removed review-priority-low Low Priority PR for Review: within 3 business days labels Sep 4, 2024
})
}

func TestGetDecoder(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest running this test and subtests in parallel.

}
}

func TestGetEncoder(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest running this test and subtests in parallel.

@blink1073 blink1073 removed the request for review from matthewdale September 9, 2024 17:07
@qingyang-hu qingyang-hu merged commit ec59e09 into mongodb:master Sep 9, 2024
30 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-priority-normal Medium Priority PR for Review: within 1 business day

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants