// CreateServiceGroup create new service group
CreateServiceGroup create new service group
// CreateServiceGroup create new service group
func (sgmr *ServiceGroupMongoRepository) CreateServiceGroup(serviceGroup ServiceGroup) error {
	serviceGroup.Id = bson.NewObjectId()
	index := mgo.Index{
		Key:        []string{"name"},
		Unique:     true,
		DropDups:   true,
		Background: true,
		Sparse:     true,
	}
	err := sgmr.Collection.EnsureIndex(index)
	if err != nil {
		return err
	}
	return sgmr.Collection.Insert(&serviceGroup)
}
func ( sgmr * ServiceGroupMongoRepository ) CreateServiceGroup ( serviceGroup ServiceGroup ) error { serviceGroup . Id = bson . NewObjectId ( ) index := mgo . Index { Key : [ ] string { " " } , Unique : true , DropDups : true , Background : true , Sparse : true , } err := sgmr . Collection . EnsureIndex ( index ) if err != nil { return err } return sgmr . Collection . Insert ( & serviceGroup ) }
CreateServiceGroup create new service group
CreateServiceGroup create new service group