func MapKvPairs(m map[string]string) []*common.KeyValuePair {
	pairs := make([]*common.KeyValuePair, 0, len(m))
	for k, v := range m {
		pairs = append(pairs, &common.KeyValuePair{
			Key:   k,
			Value: v,
		})
	}
	return pairs
}
MapKvPairs converts map into common.KeyValuePair slice
package entity
import (
	"github.com/milvus-io/milvus-sdk-go/v2/internal/proto/common"
	"github.com/milvus-io/milvus-sdk-go/v2/internal/proto/schema"
)
type Schema struct {
	CollectionName string
	Description    string
	AutoID         bool
	Fields         []*Field
}
func (s *Schema) ProtoMessage() *schema.CollectionSchema {
	r := &schema.CollectionSchema{
		Name:        s.CollectionName,
		Description: s.Description,
		AutoID:      s.AutoID,
	}
	r.Fields = make([]*schema.FieldSchema, 0, len(s.Fields))
	for _, field := range s.Fields {
		r.Fields = append(r.Fields, field.ProtoMessage())
	}
	return r
}
func (s *Schema) ReadProto(p *schema.CollectionSchema) *Schema {
	s.AutoID = p.GetAutoID()
	s.Description = p.GetDescription()
	s.CollectionName = p.GetName()
	s.Fields = make([]*Field, 0, len(p.GetFields()))
	for _, fp := range p.GetFields() {
		s.Fields = append(s.Fields, (&Field{}).ReadProto(fp))
	}
	return s
}
type Field struct {
	ID          int64   
	Name        string  
	PrimaryKey  bool    
	AutoID      bool    
	Description string
	DataType    FieldType
	TypeParams  map[string]string
	IndexParams map[string]string
}
func (f *Field) ProtoMessage() *schema.FieldSchema {
	return &schema.FieldSchema{
		FieldID:      f.ID,
		Name:         f.Name,
		Description:  f.Description,
		IsPrimaryKey: f.PrimaryKey,
		AutoID:       f.AutoID,
		DataType:     schema.DataType(f.DataType),
		TypeParams:   MapKvPairs(f.TypeParams),
		IndexParams:  MapKvPairs(f.IndexParams),
	}
}
func (f *Field) ReadProto(p *schema.FieldSchema) *Field {
	f.ID = p.GetFieldID()
	f.Name = p.GetName()
	f.PrimaryKey = p.GetIsPrimaryKey()
	f.AutoID = p.GetAutoID()
	f.Description = p.GetDescription()
	f.DataType = FieldType(p.GetDataType())
	f.TypeParams = KvPairsMap(p.GetTypeParams())
	f.IndexParams = KvPairsMap(p.GetIndexParams())
	return f
}