code: func (c *Connector) Upsert(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error {
  	err := validateSchema(ei)
  	if err != nil {
  		return err
  	}
  
  	keyName, valueName := nameOfKeyValue(ei)
  
  	cacheValue, ok := values[valueName]
  	if !ok || cacheValue == nil {
  		return NewErrInvalidEntity("No value specified.")
  	}
  
  	cacheValueBytes := cacheValue.([]byte)
  	if len(cacheValueBytes) == 0 {
  		return NewErrInvalidEntity("No value specified.")
  	}
  
  	cacheKey, err := buildKey(c.keyPrefix, ei.Ref.Scope, ei.Ref.NamePrefix, ei.Def.Name, values[keyName])
  	if err != nil {
  		return err
  	}
  
  	err = c.client.SetEx(cacheKey, cacheValueBytes, c.ttl)
  	c.logCallCount("Upsert", err)
  	return err
  }
docs: // Upsert means update an existing object or create a new object