const choiceUpdate = async (dynamicValue) =>{
const increment = firebase.firestore.FieldValue.increment(1);
const storyRef = db.collection('group').doc(roomCode);
const response = await storyRef.update({[`businesses.${dynamicValue}.swipe`]: increment});
};
Photo of firestore db
I'm not sure how to increment swipe, the dynamicValue is the index of the [businesses] array. It's a counter for keeping track of how many people liked the restaurant.