Preserve type field if needs be

This commit is contained in:
Darren Shepherd 2019-08-07 22:43:43 -07:00
parent f4898c6187
commit a8e6947251

View File

@ -17,6 +17,10 @@ type defaultMapper struct {
}
func (d *defaultMapper) FromInternal(data map[string]interface{}) {
if t, ok := data["type"]; ok {
data["_type"] = t
}
if _, ok := data["id"]; ok || data == nil {
return
}