Currently, I am working on updating data to send a number to another user's number.
const updateNumber = async(e) => {
e.preventDefault();
const targetQuery = query(userCollection, where("keycode", "==", parseInt(target)));
const targetSnapshot = await getDocuments(targetQuery)
targetSnapshot.forEach((document) => {
console.log(document.data().num)
console.log(document.id)
const targetReference = doc(database, 'users', document.id)
setDoc(targetReference, {
num: // increment the user's data here
}, {merge: true})
})
}
Unfortunately, I have come across documentation that is hard to understand and some information I grasp is already outdated. Any help or guidance on this would be greatly appreciated :)