// UnmarshalFromDoc unmarshals the given document to the given object.
UnmarshalFromDoc unmarshals the given document to the given object.
// UnmarshalFromDoc unmarshals the given document to the given object .
func UnmarshalFromDoc(doc Document, obj interface{}) error {
	raw, err := json.Marshal(doc)
	if err != nil {
		return err
	}
	err = json.Unmarshal(raw, obj)
	if err != nil {
		return err
	}
	return nil
}
func UnmarshalFromDoc ( doc Document , obj interface { } ) error { raw , err := json . Marshal ( doc ) if err != nil { return err } err = json . Unmarshal ( raw , obj ) if err != nil { return err } return nil }
UnmarshalFromDoc unmarshals the given document to the given object.
UnmarshalFromDoc unmarshals the given document to the given object .