top of page

Portfolio 1 Week 6: Firebase

  • Writer: J J
    J J
  • Nov 29, 2019
  • 2 min read

Updated: Jan 4, 2020

In week 6, my class was taught how to store and edit information on firebase database by installing the firebase library into python.

The database I created was public, which can be edited by anyone who has access to that link, hence I was able to use the URL to post and edit information on that database. Firstly, I made a post on the database, which added a branch to the main tree called "temperature", this is done using the command firebase.post() and I was able to add more branches to it by placing more information after the "temperature", separating them by a comma and {} bracers if there was more than 1 branch for that section.







I can also access the json files on the firebase by going to the page itself, where I can access different branches of the database by using something similar to a file path behind the database url.

As you can see, behind the firebase URL, I added the path to S456F, which allowed me to view the remaining branches which are extended from S456F.

Data can also be edited by using the firebase.patch() command, and the parameters contain the pathing to the part of the database needed to be edited, as well as the changed data.

The data from the firebase can also be deleted using firebase.delete(), which is roughly the same as how firebase.patch(), just that the parameters are slightly different.

When we use firebase.post(), the firebase automatically generates a "key" for the data. However, I am able to set my own "key" by using firebase.put(), which allows me to create an entirely new path where I get to set all its data.

The S456F was not an auto-generated key that firebase assigned, but it was set by the python command instead, by using firebase.put().

Recent Posts

See All

Comments


Post: Blog2_Post

©2019 by JiongJie. Proudly created with Wix.com

bottom of page