Can someone tell me why this does not work:
const deleteItem = index => {
firebase
.firestore()
.collection("user")
.doc(user1)
.update({
Travellers : firebase.firestore.FieldValue.arrayRemove({Name: item.Travellers[index].Name, Weight: item.Travellers[index].Weight})
})
};
The array:
[
{
"id": "rWFZhAKk9eOSIIFoP0DqqvrC6WJ3",
"Travellers": [
{
"Name": "Mike",
"Weight": "100.00"
},
{
"Name": "Bob",
"Weight": "95.00"
}
]
}
]
The code works fine for arrayUnion when adding to this array, but removing it is not. If I hardcode the values into Name and Weight then it removes just fine.
Console returns (before the firebase.update) Mike and 100.00 as index 0.
Firebase screenshot:

item.Travellers[index].Nameare not the same as the hard-coded values. Running the code in a debugger is probably the fastest way to determine why that is.