I’m new to web development, so I’m extremely sorry if the question is rife with inaccuracies.
My firestore database is composed like so:
Is there a way in which I could update bookname under a specific card (for instance card1)
Right now my approach is to use the following function:
But when I execute the IssueBook()
function, I get an error shown on the console:
As far as I can see, the card1 field does have two fields within which can be updated so what does the console message imply?
Thank you in advance!
2
Answers
It looks like you have a nested field under
LibCard
. To update a field in a nested object you can use dot notation:In my case category is an array this must me exact name of existing nested object in a document.
Console.log category array on React Native
Firebase document.