Thank you for the feedback. So no issues with how I handle populating the database? I thought that might be an issue but it was more of a feeling.
I know what you mean about the naming of index. I will rename that.
Others have voted so is it possible that the voting worked but you hadn’t realised because the list re-orders when a vote is cast? I say this because I thought the same thing a few times and that was the case. I plan on adding some sort of notice to make the user aware they’ve cast a vote.
On a side issue I don’t suppose you know of a way to handle only voting the once but being able to cast the opposite vote, meaning you could upvote, downvote, upvote but not upvote upvote or downvote downvote. I was thinking or splitting the ips array into an object with up and down arrays inside as a possible solution.