You need to reference the key child-node to update.
Never used Firebase with AppGameKit, but work with it daily in Go. The code example below should be pretty easy to follow:
// UpdateSMSAvailableFB will update number of SMS messages a given tenant have available
func UpdateSMSAvailableFB(ctx context.Context, c *db.Client, tID string, smsNew int) error {
fn := "UpdateSMSAvailableFB"
ref := c.NewRef("tenants").Child(tID).Child("smsOverview")
if err := ref.Update(ctx, map[string]interface{}{
"available": smsNew,
}); err != nil {
return fmt.Errorf("error, %s updating sms amount: %v", fn, err)
}
return nil
}
Of course, the AppGameKit syntax will be different. The important bits being:
ref := c.NewRef("tenants").Child(tID).Child("smsOverview")
This sets the node to be updated, where tID is the customer ID, the full Firebase path would look something like "tenants/1234/smsOverview/"
if err := ref.Update(ctx, map[string]interface{}{
"available": smsNew,
This sets the "available" node (or variable-name if you wish) under ""tenants/1234/smsOverview/" to its new value. The ctx variable is the context (connection, thread etc - most of it auto-managed in Go) and the map[string]interface{} is merely telling the type of key and value(s) will be inserted/updated. The [string] part is the "available" variable-name, the interface{} part is a type agnostic method which in this case will default to the int type of the "smsNew" value.