INNER CODE UNIT · Go

normalizeDocMap

rwynn/gtm · gtm.go:859

func normalizeDocMap(m map[string]interface{}) map[string]interface{} {
	o := map[string]interface{}{}
	for k, v := range m {
		switch child := v.(type) {
		case map[string]interface{}:
			o[k] = normalizeDocMap(child)
		case primitive.M:
			o[k] = normalizeDocMap(map[string]interface{}(child))
		case primitive.D:
			o[k] = normalizeDocMap(map[string]interface{}(child.Map()))
		case []interface{}:
			o[k] = normalizeDocSlice(child)
		case primitive.A:
			o[k] = normalizeDocSlice([]interface{}(child))
		default:
			o[k] = v
		}
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…