func NewDecoder(vr bsonrw.ValueReader) (*Decoder, error) {
	if vr == nil {
		return nil, errors.New("cannot create a new Decoder with a nil ValueReader")
	}
	return &Decoder{
		dc: bsoncodec.DecodeContext{Registry: DefaultRegistry},
		vr: vr,
	}, nil
}
NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr.
package bson
import (
	"errors"
	"fmt"
	"reflect"
	"sync"
	"go.mongodb.org/mongo-driver/bson/bsoncodec"
	"go.mongodb.org/mongo-driver/bson/bsonrw"
)
var ErrDecodeToNil = errors.New("cannot Decode to nil value")
var decPool = sync.Pool{
	New: func() interface{} {
		return new(Decoder)
	},
}
type Decoder struct {
	dc bsoncodec.DecodeContext
	vr bsonrw.ValueReader
}