Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/golang.org/x/crypto-…
Browse files Browse the repository at this point in the history
…0.27.0
  • Loading branch information
blink1073 authored Sep 9, 2024
2 parents addd630 + 352dcce commit 84e52ec
Show file tree
Hide file tree
Showing 21 changed files with 277 additions and 37 deletions.
2 changes: 1 addition & 1 deletion examples/_logger/logrus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
)
3 changes: 2 additions & 1 deletion examples/_logger/logrus/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
2 changes: 1 addition & 1 deletion examples/_logger/zap/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.14.0 // indirect
)
4 changes: 2 additions & 2 deletions examples/_logger/zap/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
2 changes: 1 addition & 1 deletion examples/_logger/zerolog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
)
4 changes: 2 additions & 2 deletions examples/_logger/zerolog/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/benchmark/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 2 additions & 2 deletions internal/cmd/benchmark/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/compilecheck/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.14.0 // indirect
)
4 changes: 2 additions & 2 deletions internal/cmd/compilecheck/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/faas/awslambda/mongodb/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.14.0 // indirect
)

Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/faas/awslambda/mongodb/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
9 changes: 3 additions & 6 deletions internal/codecutil/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (e MarshalError) Error() string {
}

// EncoderFn is used to functionally construct an encoder for marshaling values.
type EncoderFn func(io.Writer) (*bson.Encoder, error)
type EncoderFn func(io.Writer) *bson.Encoder

// MarshalValue will attempt to encode the value with the encoder returned by
// the encoder function.
Expand All @@ -49,14 +49,11 @@ func MarshalValue(val interface{}, encFn EncoderFn) (bsoncore.Value, error) {

buf := new(bytes.Buffer)

enc, err := encFn(buf)
if err != nil {
return bsoncore.Value{}, err
}
enc := encFn(buf)

// Encode the value in a single-element document with an empty key. Use
// bsoncore to extract the first element and return the BSON value.
err = enc.Encode(bson.D{{Key: "", Value: val}})
err := enc.Encode(bson.D{{Key: "", Value: val}})
if err != nil {
return bsoncore.Value{}, MarshalError{Value: val, Err: err}
}
Expand Down
6 changes: 2 additions & 4 deletions internal/codecutil/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ import (
func testEncFn(t *testing.T) EncoderFn {
t.Helper()

return func(w io.Writer) (*bson.Encoder, error) {
return func(w io.Writer) *bson.Encoder {
rw := bson.NewDocumentWriter(w)
enc := bson.NewEncoder(rw)

return enc, nil
return bson.NewEncoder(rw)
}
}

Expand Down
175 changes: 175 additions & 0 deletions internal/integration/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ func (e *negateCodec) DecodeValue(_ bson.DecodeContext, vr bson.ValueReader, val
return nil
}

type intKey int

func (i intKey) MarshalKey() (string, error) {
return fmt.Sprintf("key_%d", i), nil
}

var _ options.ContextDialer = &slowConnDialer{}

// A slowConnDialer dials connections that delay network round trips by the given delay duration.
Expand Down Expand Up @@ -724,6 +730,20 @@ func TestClient_BSONOptions(t *testing.T) {
C string `json:"y" bson:"3"`
}

type omitemptyTest struct {
X jsonTagsTest `bson:"x,omitempty"`
}

type truncatingDoublesTest struct {
X int
}

type timeZoneTest struct {
X time.Time
}

timestamp, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05+07:00")

testCases := []struct {
name string
bsonOpts *options.BSONOptions
Expand Down Expand Up @@ -766,6 +786,88 @@ func TestClient_BSONOptions(t *testing.T) {
AppendInt32("x", 1).
Build()),
},
{
name: "NilMapAsEmpty",
bsonOpts: &options.BSONOptions{
NilMapAsEmpty: true,
},
doc: bson.D{{Key: "x", Value: map[string]string(nil)}},
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{{Key: "x", Value: bson.D{}}},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().
AppendDocument("x", bsoncore.NewDocumentBuilder().Build()).
Build()),
},
{
name: "NilSliceAsEmpty",
bsonOpts: &options.BSONOptions{
NilSliceAsEmpty: true,
},
doc: bson.D{{Key: "x", Value: []int(nil)}},
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{{Key: "x", Value: bson.A{}}},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().
AppendArray("x", bsoncore.NewDocumentBuilder().Build()).
Build()),
},
{
name: "NilByteSliceAsEmpty",
bsonOpts: &options.BSONOptions{
NilByteSliceAsEmpty: true,
},
doc: bson.D{{Key: "x", Value: []byte(nil)}},
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{{Key: "x", Value: bson.Binary{Data: []byte{}}}},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().
AppendBinary("x", 0, nil).
Build()),
},
{
name: "OmitZeroStruct",
bsonOpts: &options.BSONOptions{
OmitZeroStruct: true,
},
doc: omitemptyTest{},
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().Build()),
},
{
name: "StringifyMapKeysWithFmt",
bsonOpts: &options.BSONOptions{
StringifyMapKeysWithFmt: true,
},
doc: map[intKey]string{intKey(42): "foo"},
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{{"42", "foo"}},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().
AppendString("42", "foo").
Build()),
},
{
name: "AllowTruncatingDoubles",
bsonOpts: &options.BSONOptions{
AllowTruncatingDoubles: true,
},
doc: bson.D{{Key: "x", Value: 3.14}},
decodeInto: func() interface{} { return &truncatingDoublesTest{} },
want: &truncatingDoublesTest{3},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().
AppendDouble("x", 3.14).
Build()),
},
{
name: "BinaryAsSlice",
bsonOpts: &options.BSONOptions{
BinaryAsSlice: true,
},
doc: bson.D{{Key: "x", Value: []byte{42}}},
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{{Key: "x", Value: []byte{42}}},
wantRaw: bson.Raw(bsoncore.NewDocumentBuilder().
AppendBinary("x", 0, []byte{42}).
Build()),
},
{
name: "DefaultDocumentM",
bsonOpts: &options.BSONOptions{
Expand All @@ -775,6 +877,50 @@ func TestClient_BSONOptions(t *testing.T) {
decodeInto: func() interface{} { return &bson.D{} },
want: &bson.D{{Key: "doc", Value: bson.M{"a": int64(1)}}},
},
{
name: "UseLocalTimeZone",
bsonOpts: &options.BSONOptions{
UseLocalTimeZone: true,
},
doc: bson.D{{Key: "x", Value: timestamp}},
decodeInto: func() interface{} { return &timeZoneTest{} },
want: &timeZoneTest{timestamp.In(time.Local)},
},
{
name: "ZeroMaps",
bsonOpts: &options.BSONOptions{
ZeroMaps: true,
},
doc: bson.D{{"a", "apple"}, {"b", "banana"}},
decodeInto: func() interface{} {
return &map[string]string{
"b": "berry",
"c": "carrot",
}
},
want: &map[string]string{
"a": "apple",
"b": "banana",
},
},
{
name: "ZeroStructs",
bsonOpts: &options.BSONOptions{
ZeroStructs: true,
},
doc: bson.D{{"a", "apple"}, {"x", "broccoli"}},
decodeInto: func() interface{} {
return &jsonTagsTest{
B: "banana",
C: "carrot",
}
},
want: &jsonTagsTest{
A: "apple",
B: "broccoli",
C: "",
},
},
}

for _, tc := range testCases {
Expand Down Expand Up @@ -809,6 +955,35 @@ func TestClient_BSONOptions(t *testing.T) {
}

opts := mtest.NewOptions().ClientOptions(
options.Client().SetBSONOptions(&options.BSONOptions{
ObjectIDAsHexString: true,
}))
mt.RunOpts("ObjectIDAsHexString", opts, func(mt *mtest.T) {
res, err := mt.Coll.InsertOne(context.Background(), bson.D{{"x", 42}})
require.NoError(mt, err, "InsertOne error")

sr := mt.Coll.FindOne(
context.Background(),
bson.D{{Key: "_id", Value: res.InsertedID}},
)

type data struct {
ID string `bson:"_id"`
X int `bson:"x"`
}
var got data

err = sr.Decode(&got)
require.NoError(mt, err, "Decode error")

want := data{
ID: res.InsertedID.(bson.ObjectID).Hex(),
X: 42,
}
assert.Equal(mt, want, got, "expected and actual decoded result are different")
})

opts = mtest.NewOptions().ClientOptions(
options.Client().SetBSONOptions(&options.BSONOptions{
ErrorOnInlineDuplicates: true,
}))
Expand Down
3 changes: 3 additions & 0 deletions mongo/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ func getDecoder(
if opts.DefaultDocumentM {
dec.DefaultDocumentM()
}
if opts.ObjectIDAsHexString {
dec.ObjectIDAsHexString()
}
if opts.UseJSONStructTags {
dec.UseJSONStructTags()
}
Expand Down
Loading

0 comments on commit 84e52ec

Please sign in to comment.