Skip to content

Conversation

@Oldook
Copy link
Contributor

@Oldook Oldook commented Feb 6, 2025

Summary

Database.Watch() does not pass bsonOpts to changeStreamConfig, while Collection.Watch() and Client.Watch() do.

Background & Motivation

Database.Watch() omits bsonOpts, causing any custom BSON options configured at the client level to be ignored when watching a database. As a result, it is currently necessary to explicitly use bson.Decoder with the required BSON options when decoding change stream events.

@matthewdale matthewdale self-requested a review February 6, 2025 18:41
@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the review-priority-low Low Priority PR for Review: within 3 business days label Feb 6, 2025
@mongodb-drivers-pr-bot
Copy link
Contributor

API Change Report

No changes found!

Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

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

@Oldook thank you for the fix! Looks good! 👍

@matthewdale matthewdale merged commit a513be0 into mongodb:master Feb 26, 2025
35 checks passed
@matthewdale matthewdale changed the title fix database watch function didn't set bsonOpts for changeStreamConfig GODRIVER-3492 fix database watch function didn't set bsonOpts for changeStreamConfig Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-priority-low Low Priority PR for Review: within 3 business days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants