At 45:48 we are getting id from the taskRef and immediately adding it as a field in the task. How can we do the same while using v9 addDoc function equivalent. Because add doc adds the document to the firebase but then after there is no point in adding the id and also these id are not added in the task added in the tasks and managed by React. The latest one doesnot have any id immediately in the front end. Problem with this: We cannot delete or update the immediately added task (because it doesn't have any id, it gets id on the firestore only and for that we have to refresh and then only we have the id in the task) How to fix this?
You can make your own Id using uuid etc. in v9 also there is setDoc( ) await setDoc(doc(db, "cities", "new-city-id"), data); This new city can be set on frontend itself Using addDoc might not give you any way to delete the non ID things on front end.
I learnt so much from this, thank you so much for this video.
Also for the firebase part, chatGPT and firebase docs helped a lot, even thought in this video the firebase version which you used is old
Awesome Sir, It helped alot
Source Code : github.com/coderdost/react-todo
AWESOME BRO
Nice ♥️
NIce video
Good 👍🙏👏😀
@coderdost please make video related javascript coding question from easy to hard
Like substring, palindrome, 2d array
Sure. any list or webpage listing such problems ??
Where to learn firebase from?
Like the methods and all
Firebase has a good documentation on its site. In that select JavaScript option. As firebase is available in other languages also
@@coderdost thanks for the quick response
At 45:48 we are getting id from the taskRef and immediately adding it as a field in the task. How can we do the same while using v9 addDoc function equivalent. Because add doc adds the document to the firebase but then after there is no point in adding the id and also these id are not added in the task added in the tasks and managed by React. The latest one doesnot have any id immediately in the front end.
Problem with this: We cannot delete or update the immediately added task (because it doesn't have any id, it gets id on the firestore only and for that we have to refresh and then only we have the id in the task)
How to fix this?
You can make your own Id using uuid etc. in v9 also there is setDoc( )
await setDoc(doc(db, "cities", "new-city-id"), data);
This new city can be set on frontend itself
Using addDoc might not give you any way to delete the non ID things on front end.
@@coderdost thanks will try this
14:19
Why not firebase 9 ?? u r using 8.5
Yes. I made this video with v8 and also older react. A new video will come with react v18 and latest firebase will come. But basic queries are same.
@@coderdost okay...can u tell me your vs code font-family name ??
Menlo
@@coderdost dost aapki node js playlist se mujhe bahot help mili hai . please ek vide mvc(model, view ,controller ) par bhi bana do.
@@VimalKumar-cc2ri Noted.