From 8716ba7f7610878f23de02a908dd2bd4aa5bc957 Mon Sep 17 00:00:00 2001 From: Preston Vasquez <24281431+prestonvasquez@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:07:40 -0700 Subject: [PATCH] GODRIVER-2937 Copy BSONOptions when merging coll or db opts --- mongo/options/collectionoptions.go | 3 +++ mongo/options/dboptions.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/mongo/options/collectionoptions.go b/mongo/options/collectionoptions.go index 04fda6d779..7904dbd672 100644 --- a/mongo/options/collectionoptions.go +++ b/mongo/options/collectionoptions.go @@ -95,6 +95,9 @@ func MergeCollectionOptions(opts ...*CollectionOptions) *CollectionOptions { if opt.Registry != nil { c.Registry = opt.Registry } + if opt.BSONOptions != nil { + c.BSONOptions = opt.BSONOptions + } } return c diff --git a/mongo/options/dboptions.go b/mongo/options/dboptions.go index 8a380d2168..38ee13550b 100644 --- a/mongo/options/dboptions.go +++ b/mongo/options/dboptions.go @@ -95,6 +95,9 @@ func MergeDatabaseOptions(opts ...*DatabaseOptions) *DatabaseOptions { if opt.Registry != nil { d.Registry = opt.Registry } + if opt.BSONOptions != nil { + d.BSONOptions = opt.BSONOptions + } } return d