ashie
ashie

Reputation: 13

Is there a way to use the firebase push() method without their auto generated IDs?

So I have a path called game_bans, and I want it to store the game bans by the user id, not the auto generated ID.

I'd like for it to save like this;

screenshot

But the way it works is;

screenshot

Upvotes: 0

Views: 100

Answers (1)

Mark Bolusmjak
Mark Bolusmjak

Reputation: 24409

Use ref and set. I don't know your code, but something like:

database.ref('/game_bans/' + bannedUserId).set({moderator: ... });

Upvotes: 1

Related Questions