I have a name of the song, with ratings I am saving for it.
And it looks like pic bellow, as I am using push()
to store each new rating.
But what I would like to see is, ratings
as an array of
objects, each containing something like this:
voter: {
ip: "1.1.1.1",
stars: 3,
}
So rating
key would end up being something like this:
rating: [{ip: "1.1.1.1", stars: 3}, ...]
Then I can enable only one vote per IP address. What I couldn't find in
Firebase
docs, is how to add to an existing key, in this case rating
(but it would be [list, like]) - a
new hash
like the one above.
Because push()
automatically creates hash-key
value, and I want to append
to an existing key.
EDIT: I am aware of the fact, that Firebase does not store arrays natively, however in this case it does not matter, it's just how I would like to see my data.