Now that we know how to insert and fetch data, let's take a look at how to update data in our database.
As we've already seen before, we can use the console of our browser to play with the database. For our next examples, we will use only the console to see how Meteor reactively changes the templates when we change data.
To be able to edit a post in our database, we first need to know the
_id field of its entry. To find this out, we need to type the following command:
This will return us all the documents in the
Posts collection, as we are not passing any specific query object.
In the returned array, we need to take a look at the last item, with the My Fifth entry title, and copy the
_id field to the clipboard ...