pythonfirebasefirebase-realtime-databasepyrebase

How to append new entry in child pyrebase


the Below code replaces the previous entry but i want to add new entry or append the new entry in the child name Friends_email please if any one can help me. I am using python 3.9 with Pyrebase 3.0.27.

li = {"1":"gurjar"}
db.child("Users").child("nishant").child("Friend_list").child("Friends_email").set(li)

Solution

  • Yes previously I was writing.

    li = {"1":"gurjar"}
    db.child("Users").child("nishant").child("Friend_list").child("Friends_email").set(li)
    

    But now I am using

    db.child("Users").child("nishant").child("Friend_list").child("Friends_email").child(1).set(“gurjar”)
    

    Now if I will change child 1 to 2 then it will append it in the child Friends_email.