I'm trying to update a document in my firestore from my React app. To update the value, I'm trying to get the document where the value uid
is equal to my current user's id. I'm using Firebase V9 and here is my code :
if(myDescription.length < 15){
alert("The description must be longer !")
return
}
const currentUID = auth.currentUser.uid
const myDoc = doc(collection(db, "descriptions"), where("uid", "==", currentUID))
await setDoc(myDoc, {desc: myDescription})
But when I execute it I have got this error :
Uncaught (in promise) TypeError: n.indexOf is not a function
at rt.fromString (index.esm2017.js:1032:1)
at sa (index.esm2017.js:16044:1)
at handleClick (Description.js:38:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
at executeDispatch (react-dom.development.js:9041:1)
at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1)
at processDispatchQueue (react-dom.development.js:9086:1)