Rahul Vyas
Rahul Vyas

Reputation: 28720

Firebase realtime database Rest API refer object

I'm using firebase rest API in my project. I have following data in firebase realtime database.

Users {
  -asgfhgkho {
     name:Rahul Vyas
    email: [email protected]
   }
}
History {
-124lahsfaksfh {
  players {
   -asdfghjikjdlk {
     name:Rahul Vyas
     email: [email protected] }
   }
  }
 }

Now my question is if I update the name property using patch. How the name will be reflected under History->players->{playerId}->name. How we can refer an user object in multiple different nodes. Note I'm using firebase rest API.

Thanks

Upvotes: 0

Views: 129

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599176

You will need to update those names yourself by writing code for it.

Since you must know the exact path to perform write to it, that means you'll typically:

  1. Perform a query to determine what nodes to update
  2. Perform an update for each, or a single multi-location update

Upvotes: 2

Related Questions