code: func indexUpdate(typeName, indexName string, index Index, tx *bolt.Tx, key []byte, value interface{}, delete bool) error {
  	indexKey, err := index(indexName, value)
  	if indexKey == nil {
  		return nil
  	}
  
  	indexValue := make(keyList, 0)
  
  	if err != nil {
  		return err
  	}
  
  	b, err := tx.CreateBucketIfNotExists(indexBucketName(typeName, indexName))
  	if err != nil {
  		return err
  	}
  
  	iVal := b.Get(indexKey)
  	if iVal != nil {
  		err = decode(iVal, &indexValue)
  		if err != nil {
  			return err
  		}
  	}
  
  	if delete {
  		indexValue.remove(key)
  	} else {
  		indexValue.add(key)
  	}
  
  	if len(indexValue) == 0 {
  		return b.Delete(indexKey)
  	}
  
  	iVal, err = encode(indexValue)
  	if err != nil {
  		return err
  	}
  
  	return b.Put(indexKey, iVal)
  }
docs: // adds or removes a specific index on an item