Using this thread as a reference How to delete object from array in firestore I wanted to take this a little further and understand how to delete an object from a array in firestore.
I have my firestore setup like such:
Users(collection) -> 12345(document) -> myArray:[{x:"hello", y:"please"}, {x:"hello", y:"thanks"}]
I am trying to arrayRemove a specific object based on its values.
This is my current code and it does not work despite reading other posts that say it should.
import firestore from '@react-native-firebase/firestore'; //EDIT
let obj = {x:"hello", y:"thanks"}
firestore()
.collection("Users")
.doc("12345")
.update({
myArray: firestore.FieldValue.arrayRemove(obj),
}).then(r =>console.log("YEAAAH"))
Any suggestions on what I could try? or any good workarounds?
P.S. I am doing this on client-side of my React Native app and I would prefer not having to call an endpoint.