I'm trying to update the likes on a post from the app when a button is pressed. The posts are located in an array and I'm trying to update the int of the likes of the post.
There is no way to update an item in an array by an index. You'll have to read the document, get the current value for the posts array, update that, and write the entire (updated) array back to the database.
postsarray, update that, and write the entire (updated) array back to the database.