func (s *Storage) UpdateGlobal(k string, i interface{}) error {
	data, err := s.SQL.toInterfaceMap(i)
	if err != nil {
		return wrapErr(err)
	}
	c := s.GetAD()
	for j := range s.GetAllData() {
		s.SetAD(j)
		if _, err := s.GetPath(k); err != nil {
			continue
		}
		err := s.SQL.upsertRecursive(strings.Split(k, "."), s.GetData(), data)
		if err != nil {
			return wrapErr(err)
		}
	}
	s.SetAD(c)
	return s.stateReload()
}
UpdateGlobal is a SQL wrapper for adding/updating map structures
in all documents. This will change all existing paths to the given
structure (if any)
package db
import (
	"strings"
)
func (s *Storage) Upsert(k string, i interface{}) error {
	data, err := s.SQL.toInterfaceMap(i)
	if err != nil {
		return wrapErr(err)
	}
	err = s.SQL.upsertRecursive(strings.Split(k, "."), s.GetData(), data)
	if err != nil {
		return wrapErr(err)
	}
	return s.stateReload()
}
func (s *Storage) UpsertGlobal(k string, i interface{}) error {
	data, err := s.SQL.toInterfaceMap(i)
	if err != nil {
		return wrapErr(err)
	}
	c := s.GetAD()
	for j := range s.GetAllData() {
		s.SetAD(j)
		err := s.SQL.upsertRecursive(strings.Split(k, "."), s.GetData(), data)
		if err != nil {
			return wrapErr(err)
		}
	}
	s.SetAD(c)
	return s.stateReload()
}