Skip to content

Commit f5c8323

Browse files
GODRIVER-2937 Copy BSONOptions when merging coll or db opts (#1483)
1 parent 3adad2b commit f5c8323

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

mongo/options/collectionoptions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func MergeCollectionOptions(opts ...*CollectionOptions) *CollectionOptions {
9595
if opt.Registry != nil {
9696
c.Registry = opt.Registry
9797
}
98+
if opt.BSONOptions != nil {
99+
c.BSONOptions = opt.BSONOptions
100+
}
98101
}
99102

100103
return c

mongo/options/dboptions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func MergeDatabaseOptions(opts ...*DatabaseOptions) *DatabaseOptions {
9595
if opt.Registry != nil {
9696
d.Registry = opt.Registry
9797
}
98+
if opt.BSONOptions != nil {
99+
d.BSONOptions = opt.BSONOptions
100+
}
98101
}
99102

100103
return d

0 commit comments

Comments
 (0)