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
}
// Document constructs a Value from the given IDoc. If nil is provided, a BSON Null value will be
// returned.
Document constructs a Value from the given IDoc. If nil is provided, a BSON Null value will be
returned.
// Document constructs a Value from the given IDoc . If nil is provided a BSON Null value will be // returned .
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 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 }
Document constructs a Value from the given IDoc.
Document constructs a Value from the given IDoc .