I’m new to working with databases and need some help with updating an array in my Firestore using arrayUnion(). This is a React Native project using Expo.
This is the function I’m using:
await updateDoc(doc(db, "Habits", (habitId)), { completed: arrayUnion("hello") })
This is a screenshot of my DB:
enter image description here
This is the error I’m getting in the console:
Uncaught (in promise) FirebaseError: No document to update: projects/habitful-c5e3c/databases/(default)/documents/Habits/3fG9PvcfyMLHGTU2XR6s
Let me know if you need more information.
Thanks!
I’ve tried multiple variations, but none have worked.