I have these codes to make the Like functionality
/*Here I increment by 1 every time someone submit like*/
db.collection("post").doc(postId).update({
likes: increment
})
/*Here I collect the uid of the user who submit Like and append to an Array*/
db.collection('post').doc(postId).update( {
usersArray: firebase.firestore.FieldValue.arrayUnion( userId )
});
now is possible to have code that runs every time someone submits Like to check if the user already exists in the usersArray?