func Array(arr Arr) Val {
	if arr == nil {
		return Val{t: bsontype.Null}
	}
	return Val{t: bsontype.Array, primitive: arr}
}
Array constructs a Value from arr. If arr is nil, a BSON Null value is returned.
package bsonx
import (
	"encoding/binary"
	"math"
	"time"
	"go.mongodb.org/mongo-driver/bson/bsontype"
	"go.mongodb.org/mongo-driver/bson/primitive"
)
type IDoc interface {
	idoc()
}
func Double(f64 float64) Val {
	v := Val{t: bsontype.Double}
	binary.LittleEndian.PutUint64(v.bootstrap[0:8], math.Float64bits(f64))
	return v
}
func String(str string) Val { return Val{t: bsontype.String}.writestring(str) }
func Document(doc IDoc) Val {
	var v Val
	switch tt := doc.(type) {
	case Doc:
		if tt == nil {
			v.t = bsontype.Null
			break
		}
		v.t = bsontype.EmbeddedDocument
		v.primitive = tt
	case MDoc:
		if tt == nil {
			v.t = bsontype.Null
			break
		}
		v.t = bsontype.EmbeddedDocument
		v.primitive = tt
	default:
		v.t = bsontype.Null
	}
	return v
}