func NewStringCodec(opts ...*bsonoptions.StringCodecOptions) *StringCodec {
	stringOpt := bsonoptions.MergeStringCodecOptions(opts...)
	return &StringCodec{*stringOpt.DecodeObjectIDAsHex}
}
NewStringCodec returns a StringCodec with options opts.
package bsoncodec
import (
	"fmt"
	"reflect"
	"go.mongodb.org/mongo-driver/bson/bsonoptions"
	"go.mongodb.org/mongo-driver/bson/bsonrw"
	"go.mongodb.org/mongo-driver/bson/bsontype"
)
type StringCodec struct {
	DecodeObjectIDAsHex bool
}
var (
	defaultStringCodec = NewStringCodec()
	_ ValueCodec  = defaultStringCodec
	_ typeDecoder = defaultStringCodec
)