Firebase - Update value to database

In this blog post, We’ll learn, how to use update method to update a value to realtime database in Firebase. This is an example written in react/react-native application

In this Example, we will be using

  1. React
  2. Firebase

Prerequisite

  1. Expecting that you have created a project ready in firebase and
  2. You have integrated the firebase config file in your react or react-native application.


Getting Started

Add the following code to update an item Buy Groceries and the status of the item to completed as true

    database.ref('/todoitems').update({
      [id]: {
        todoItemName: "Buy Groceries",
        done: true
      }
    })