React devs might find this archived course helpful to reference, but this course has been updated! We now recommend you take the Firebase Fundamentals course.

Check out a free preview of the full Firebase with React, v2 course:
The "Update a Document Exercise" Lesson is part of the full, Firebase with React, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to implement the star functionality to the application using the method learned from removing a post.

Get Unlimited Access Now

Transcript from the "Update a Document Exercise" Lesson

>> Steve Kinney: Now it is your turn. What you're gonna do is we have the ability to remove.
>> Steve Kinney: There are two different ways to modify a reference, right, to modify a document. One is set, which kind of wipes it out completely and also is useful if you know exactly whether you want to create one.

[00:00:28] But if you just want to update a single property, right, it won't wipe away the entire object, the entire document. You can basically go ahead and use update, and update will basically take those properties and those values and merge them into the existing document. So your job is, in our post component, we wanna go ahead, and the same way that we have a remove, we wanna go ahead for the star.

[00:00:49] And we can start by incrementing it. One would argue, yes, you can hit star multiple times and keep going ahead and star it a thousand times. You know how in Medium, you can hold the thing like for the claps? Same basic concept here, but we wanna just practice to being able to actually modify one, and seeing it in both places.

[00:01:08] So I will go ahead.