func Time(t time.Time) Val {
	return Val{t: bsontype.DateTime}.writei64(t.Unix()*1e3 + int64(t.Nanosecond()/1e6))
}
Time constructs a BSON datetime Value.
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
}
func Array(arr Arr) Val {
	if arr == nil {
		return Val{t: bsontype.Null}
	}
	return Val{t: bsontype.Array, primitive: arr}
}
func Binary(subtype byte, data []byte) Val {
	return Val{t: bsontype.Binary, primitive: primitive.Binary{Subtype: subtype, Data: data}}
}
func Undefined() Val { return Val{t: bsontype.Undefined} }
func ObjectID(oid primitive.ObjectID) Val {
	v := Val{t: bsontype.ObjectID}
	copy(v.bootstrap[0:12], oid[:])
	return v
}
func Boolean(b bool) Val {
	v := Val{t: bsontype.Boolean}
	if b {
		v.bootstrap[0] = 0x01
	}
	return v
}
func DateTime(dt int64) Val { return Val{t: bsontype.DateTime}.writei64(dt) }